minecraft:spawn_on_death for you with a switch.Get GodCraftOverview
minecraft:spawn_on_death is an entity component: it goes in the components object of a custom mob, or in one of its component groups. Spawns new entities when this one dies, for example a slime splitting into smaller slimes.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
entity_to_spawn | string | "self" | Entity to spawn; leave it out to spawn more of this same entity. |
spawn_method | string | "spawned" | How the new entities are created: born, spawned or summoned. |
spawn_amount | integer | 1 | How many entities to spawn. |
inherit_parent_name | boolean | true | If true, the new entities keep the custom name of the one that died. |
additional_spawn_range | IntRange | {"max":0,"min":0} | A random extra number of entities added on top of the spawn amount. |
filters | Filter Group | {"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null} | Conditions that must be true for anything to spawn. |
Example
Inside the components object of BP/entities/<name>.json (values are the defaults or placeholders):
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
}
}
}