跳转至

Transformation

文档版本:1.21.0.24

Defines an entity's transformation from the current definition into another

架构

transformation:
{
  object "add" : opt
  {
    array "component_groups" : opt
    {
      string "<any array element>" : opt
    }
  }
  sound_event "begin_transform_sound"
  number "delay" : opt
  object "delay" : opt
  {
    number "block_assist_chance" : opt
    number "block_chance" : opt
    integer "block_max" : opt
    integer "block_radius" : opt
    array "block_types" : opt
    {
      identifier "<any array element>"
    }
    number "value" : opt
  }
  boolean "drop_equipment" : opt
  boolean "drop_inventory" : opt
  string "into" : opt
  boolean "keep_level" : opt
  boolean "keep_owner" : opt
  boolean "preserve_equipment" : opt
  sound_event "transformation_sound"
}
addobject
List of components to add to the entity after the transformation.
add
component_groupsarray
Names of component groups to add.
component_groups
<any array element>string
begin_transform_soundsound_event
Sound to play when the transformation starts.
sound_event:
string
delaynumber
Defines the properties of the delay for the transformation.
delayobject
Defines the properties of the delay for the transformation.
delay
block_assist_chancenumber
Chance that the entity will look for nearby blocks that can speed up the transformation. Value must be between 0.0 and 1.0
block_chancenumber
Chance that, once a block is found, will help speed up the transformation.
block_maxinteger
Maximum number of blocks the entity will look for to aid in the transformation. If not defined or set to 0, it will be set to the block radius
block_radiusinteger
Distance in Blocks that the entity will search for blocks that can help the transformation.
block_typesarray
List of blocks that can help the transformation of this entity.
block_types
<any array element>identifier
identifier:
string
valuenumber
Time in seconds before the entity transforms.
drop_equipmentboolean
Cause the entity to drop all equipment upon transformation.
drop_inventoryboolean
Cause the entity to drop all items in inventory upon transformation.
intostring
Entity Definition that this entity will transform into.
keep_levelboolean
If this entity has trades and has leveled up, it should maintain that level after transformation.
keep_ownerboolean
If this entity is owned by another entity, it should remain owned after transformation.
preserve_equipmentboolean
Cause the entity to keep equipment after going through transformation.
transformation_soundsound_event
Sound to play when the entity is done transforming.