Skip to main content

Spawn Entity (Entity Action Type)

Spawns an entity at the position of the target entity, or at an offset from it.

Type ID: apoli:spawn_entity

Fields

FieldTypeDefaultDescription
entity_typeIdentifierrequiredThe ID of the entity type to spawn.
tagNBToptionalNBT data applied to the spawned entity.
entity_actionEntity Action TypeoptionalRuns on the spawned entity once it is spawned.
bientity_actionBi-entity Action TypeoptionalRuns with the entity that ran the action as the actor and the spawned entity as the target.
offsetVector{"x": 0, "y": 0, "z": 0}Moves the spawn point away from the entity by this much, in blocks.
spaceSpace"world"The frame offset is read in. "local" follows where the entity is looking, so z is forward and x is to its left.

Examples

"entity_action": {
    "type": "apoli:spawn_entity",
    "entity_type": "minecraft:zombie",
    "tag": "{NoAI:1b,IsBaby:1,HandItems:[{id:\"minecraft:gold_block\",Count:1},{}]}"
}

This spawns a baby zombie with no AI, holding a gold block, at the entity's position.

"entity_action": {
    "type": "apoli:spawn_entity",
    "entity_type": "minecraft:armor_stand",
    "offset": { "x": 0, "y": 0, "z": 2 },
    "space": "local"
}

This spawns an armor stand two blocks in front of wherever the entity is looking.