Lay Egg¶
文档版本:1.21.50.25
Allows the mob to lay an egg block on a sand block if the mob is pregnant.
架构¶
lay_egg:
{
  priority "priority"
  speed_multiplier "speed_multiplier"
  boolean "allow_laying_from_below" : opt
  descriptor "egg_type"
  number "goal_radius" : opt
  sound_event "lay_egg_sound"
  number "lay_seconds" : opt
  trigger "on_lay"
  integer "search_height" : opt
  integer "search_range" : opt
  array "target_blocks" : opt
  {
    descriptor "<any array element>"
  }
  array "target_materials_above_block" : opt
  boolean "use_default_animation" : opt
}
- priority:priority
- speed_multiplier:speed_multiplier
- allow_laying_from_below:boolean
- [EXPERIMENTAL] Allows the mob to lay its eggs from below the target if it can't get there. This is useful if the target block is water with air above, since mobs may not be able to get to the air block above water.
- egg_type:descriptor
- [EXPERIMENTAL] Block type for the egg to lay. If this is a turtle egg, the number of eggs in the block is randomly set.
- item:identifier
- item:object
- An object that describes an item.
item- tags:0
- [UNDOCUMENTED] A Molang expression ran against item or block to match.
- item_tag:string
- [UNDOCUMENTED] A tag to lookup item or block by.
descriptor:
{
  identifier "item"
  object "item" : opt
  {
    identifier "item"
    object "item" : opt
    {
    }
    0 "tags"
    string "item_tag" : opt
  }
}
- goal_radius:number
- Distance in blocks within the mob considers it has reached the goal. This is the "wiggle room" to stop the AI from bouncing back and forth trying to reach a specific spot
- lay_egg_sound:sound_event
- Sound event name for laying egg. Defaulted to lay_egg which is used for Turtles.
- lay_seconds:number
- Duration of the laying egg process in seconds.
- on_lay:trigger
- Event to run when this mob lays the egg.
- event:string
- The event to run when the conditions for this trigger are met.
- filters:filters
- 一个过滤器组。The list of conditions for this trigger to execute.
- target:subject
- The target of the event.
trigger:
array
{
  object "<any array element>" : opt
  {
    string "event" : opt
    filters "filters"
    subject "target"
  }
}
- <any array element>:object
<any array element>- search_height:integer
- Height in blocks the mob will look for a target block to move towards.
- search_range:integer
- The distance in blocks it will look for a target block to move towards.
- target_blocks:array
- Blocks that the mob can lay its eggs on top of.
target_blocks- <any array element>:descriptor
- target_materials_above_block:array
- Types of materials that can exist above the target block. Valid types are Air, Water, and Lava.
target_materials_above_block- use_default_animation:boolean
- Specifies if the default lay-egg animation should be played when the egg is placed or not.