概览
minecraft:spawn_on_death 是一个实体组件:写在自定义生物的 components 对象中,或其中某个组件组里。 这个实体死亡时生成新的实体,比如史莱姆分裂成更小的史莱姆。
字段
| 字段 | 类型 | 默认值 | 说明 |
|---|---|---|---|
entity_to_spawn | string | "self" | 要生成的实体;不填则生成更多同种实体。 |
spawn_method | string | "spawned" | 新实体的创建方式:born、spawned 或 summoned。 |
spawn_amount | integer | 1 | 要生成多少个实体。 |
inherit_parent_name | boolean | true | 为 true 时,新实体保留死亡实体的自定义名字。 |
additional_spawn_range | IntRange | {"max":0,"min":0} | 在生成数量之外随机额外增加的实体数量。 |
filters | Filter 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
}
}
}