Selector Action
Executes an action on entities selected by a target selector.
Type ID: eggolib:selector_action
Note
See Minecraft Fandom Wiki: Target selectors for more information about target selectors.
Note
In the context of this action type, the actor entity will be the entity that invoked the action while the target entity/entities will be the entities selected by the specified target selector.
Fields
Field | Type | Default | Description |
---|---|---|---|
selector |
String | The selector to use for selecting entities. It can be the username of a player, the UUID of the entity or a target selector. | |
bientity_action |
Bi-entity Action Type | optional | If specified, this action will be executed on either or both the actor and target entities. |
bientity_condition |
Bi-entity Condition Type | optional | If specified, the specified action will only be executed if this condition is fulfilled by either or both the actor and target entities. |
Examples
"entity_action": {
"type": "eggolib:selector_action",
"selector": "Steve",
"bientity_action": {
"type": "apoli:damage",
"amount": 5,
"source": {
"name": "generic"
}
}
}
This example will deal 2 and a half hearts of damage to the player named Steve.
"entity_action": {
"type": "eggolib: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 example will kill Armor Stands that have the some_tag
tag (added via the /tag
command)