跳转至

Lay Egg

文档版本:1.21.0.24

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
}
prioritypriority
priority:
integer
speed_multiplierspeed_multiplier
speed_multiplier:
number
allow_laying_from_belowboolean
[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_typedescriptor
[EXPERIMENTAL] Block type for the egg to lay. If this is a turtle egg, the number of eggs in the block is randomly set.
identifier:
string
descriptor:
{
  identifier "item"
  object "item" : opt
  {
  }
  0 "tags"
  string "item_tag" : opt
}
itemidentifier
itemobject
An object that describes an item.
item
tags0
[UNDOCUMENTED] A Molang expression ran against item or block to match.
0:
string
item_tagstring
[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
  }
}
itemidentifier
itemobject
An object that describes an item.
item
goal_radiusnumber
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_soundsound_event
[EXPERIMENTAL] Sound event name for laying egg. Defaulted to lay_egg which is used for Turtles.
sound_event:
string
lay_secondsnumber
[EXPERIMENTAL] Duration of the laying egg process in seconds.
on_laytrigger
Event to run when this mob lays the egg.
trigger:
string
trigger:
{
  string "event" : opt
  filters "filters"
  subject "target"
}
eventstring
The event to run when the conditions for this trigger are met.
filtersfilters
一个过滤器组。The list of conditions for this trigger to execute.
targetsubject
The target of the event.
subject:
string
trigger:
array
{
  object "<any array element>" : opt
  {
    string "event" : opt
    filters "filters"
    subject "target"
  }
}
<any array element>object
<any array element>
search_heightinteger
Height in blocks the mob will look for a target block to move towards.
search_rangeinteger
The distance in blocks it will look for a target block to move towards.
target_blocksarray
[EXPERIMENTAL] Blocks that the mob can lay its eggs on top of.
target_blocks
<any array element>descriptor
target_materials_above_blockarray
[EXPERIMENTAL] Types of materials that can exist above the target block. Valid types are Air, Water, and Lava.
target_materials_above_block
use_default_animationboolean
[EXPERIMENTAL] Specifies if the default lay-egg animation should be played when the egg is placed or not.