minecraft:transformation for you with a switch.Get GodCraftOverview
minecraft:transformation is an entity component: it goes in the components object of a custom mob, or in one of its component groups. Turns the entity into a different entity, like a villager changing into a zombie villager. Add it through an event when the change should happen.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
add | JSON Object | none | Component groups to add to the new entity after it transforms. |
begin_transform_sound | String | none | Sound played as the transformation begins. |
delay | JSON Object | none | Settings for waiting before the change happens. |
drop_equipment | Boolean | "false" | If true, the entity drops everything it is wearing or holding. |
drop_inventory | Boolean | "false" | If true, the entity drops the items in its inventory. |
into | String | none | The entity it becomes, optionally with an event, like minecraft:zombie<minecraft:as_adult>. |
keep_level | Boolean | "false" | If true, a trader keeps its trade level after changing. |
keep_owner | Boolean | "false" | If true, a tamed entity keeps its owner after changing. |
preserve_equipment | Boolean | "false" | If true, the new entity keeps the old entity's gear. |
transformation_sound | String | none | Sound played when the transformation finishes. |
Example
Inside the components object of BP/entities/<name>.json (values are the defaults or placeholders):
BP/entities/<name>.json
{
"minecraft:transformation": {
"add": {},
"begin_transform_sound": "",
"delay": {},
"drop_equipment": "false",
"drop_inventory": "false",
"into": "",
"keep_level": "false",
"keep_owner": "false"
}
}