Transformation¶
文档版本:1.21.50.25
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"
}
add
:object- List of components to add to the entity after the transformation.
add
component_groups
:array- Names of component groups to add.
component_groups
<any array element>
:string
begin_transform_sound
:sound_event- Sound to play when the transformation starts.
delay
:number- Defines the properties of the delay for the transformation.
delay
:object- Defines the properties of the delay for the transformation.
delay
block_assist_chance
:number- 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_chance
:number- Chance that, once a block is found, will help speed up the transformation.
block_max
:integer- 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_radius
:integer- Distance in Blocks that the entity will search for blocks that can help the transformation.
block_types
:array- List of blocks that can help the transformation of this entity.
block_types
value
:number- Time in seconds before the entity transforms.
drop_equipment
:boolean- Cause the entity to drop all equipment upon transformation.
drop_inventory
:boolean- Cause the entity to drop all items in inventory upon transformation.
into
:string- Entity Definition that this entity will transform into.
keep_level
:boolean- If this entity has trades and has leveled up, it should maintain that level after transformation.
keep_owner
:boolean- If this entity is owned by another entity, it should remain owned after transformation.
preserve_equipment
:boolean- Cause the entity to keep equipment after going through transformation.
transformation_sound
:sound_event- Sound to play when the entity is done transforming.