1. Wiki
  2. /实体
  3. /minecraft:spawn_on_death

minecraft:spawn_on_death

不想手写?在 GodCraft 里打开一个开关,就能帮你设置好 minecraft:spawn_on_death。Get GodCraft

概览

minecraft:spawn_on_death 是一个实体组件:写在自定义生物的 components 对象中,或其中某个组件组里。 这个实体死亡时生成新的实体,比如史莱姆分裂成更小的史莱姆。

字段

字段类型默认值说明
entity_to_spawnstring"self"要生成的实体;不填则生成更多同种实体。
spawn_methodstring"spawned"新实体的创建方式:born、spawned 或 summoned。
spawn_amountinteger1要生成多少个实体。
inherit_parent_namebooleantrue为 true 时,新实体保留死亡实体的自定义名字。
additional_spawn_rangeIntRange{"max":0,"min":0}在生成数量之外随机额外增加的实体数量。
filtersFilter Group{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null}生成任何东西前必须满足的条件。

示例

写在 BP/entities/<name>.json 的 components 对象中(值为默认值或占位值):

BP/entities/<name>.json
{
  "minecraft:spawn_on_death": {
    "entity_to_spawn": "self",
    "spawn_method": "spawned",
    "spawn_amount": 1,
    "inherit_parent_name": true,
    "additional_spawn_range": {
      "max": 0,
      "min": 0
    },
    "filters": {
      "AND": null,
      "NOT": null,
      "OR": null,
      "all": null,
      "all_of": null,
      "any": null,
      "any_of": null,
      "none_of": null
    }
  }
}

We use cookies to improve your experience and analyse site traffic. Learn more