Skip to main content

Selector Action (Entity Action Type)

Runs a bi-entity action on the entities a target selector finds. The actor is the entity that ran the action, and each selected entity is a target.

Type ID: apoli:selector_action

[Minecraft Wiki: Target selectors](

https://minecraft.wiki/w/Target_selectors) explains how target selectors work.

Fields

FieldTypeDefaultDescription
selectorStringrequiredWhich entities to select: a player's username, an entity's UUID or a target selector.
bientity_actionBi-entity Action TypeoptionalRuns for each selected entity, with the entity that ran the action as the actor and the selected entity as the target.
bientity_conditionBi-entity Condition TypeoptionalThe action only runs for selected entities that pass this, with the same actor and target.

Examples

"entity_action": {
    "type": "apoli:selector_action",
    "selector": "Steve",
    "bientity_action": {
        "type": "apoli:damage",
        "amount": 5,
        "damage_type": "minecraft:generic"
    }
}

This deals 2.5 hearts of damage to the player named Steve.

"entity_action": {
    "type": "apoli:selector_action",
    "selector": "@e[type = minecraft:armor_stand, tag = some_tag]",
    "bientity_action": {
        "type": "apoli:target_action",
        "action": {
            "type": "apoli:execute_command",
            "command": "kill @s"
        }
    }
}

This kills the armor stands that have the some_tag tag (added with the /tag command).