跳转至

Spawn Entity

文档版本:1.21.0.24

Adds a timer after which this entity will spawn another entity or item (similar to vanilla's chicken's egg-laying behavior).

架构

spawn_entity:
{
  object "entities" : opt
  {
    filters "filters"
    integer "max_wait_time" : opt
    integer "min_wait_time" : opt
    integer "num_to_spawn" : opt
    boolean "should_leash" : opt
    boolean "single_use" : opt
    string "spawn_entity" : opt
    string "spawn_event" : opt
    descriptor "spawn_item"
    string "spawn_method" : opt
    sound_event "spawn_sound"
    event_object "spawn_item_event"
  }
  array "entities" : opt
  {
    object "<any array element>" : opt
    {
    }
  }
}
entitiesobject
The entities to spawn.
entities
filtersfilters
一个过滤器组。If present, the specified entity will only spawn if the filter evaluates to true.
max_wait_timeinteger
Maximum amount of time to randomly wait in seconds before another entity is spawned.
min_wait_timeinteger
Minimum amount of time to randomly wait in seconds before another entity is spawned.
num_to_spawninteger
The number of entities of this type to spawn each time that this triggers.
should_leashboolean
If true, this the spawned entity will be leashed to the parent.
single_useboolean
If true, this component will only ever spawn the specified entity once.
spawn_entitystring
Identifier of the entity to spawn, leave empty to spawn the item defined above instead.
spawn_eventstring
Event to call when the entity is spawned.
spawn_itemdescriptor
Item identifier of the item to spawn.
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
spawn_methodstring
Method to use to spawn the entity.
spawn_soundsound_event
Identifier of the sound effect to play when the entity is spawned.
sound_event:
string
spawn_item_eventevent_object
Event to call on this entity when the item is spawned.
event_object:
{
  filters "filters"
  string "event" : opt
  string "target" : opt
}
filtersfilters
一个过滤器组
eventstring
The event to fire.
targetstring
The target of the event.
entitiesarray
The entities to spawn.
entities
<any array element>object
<any array element>