Has Command Tag (Entity Condition Type)
Passes when the entity carries one of the given command tags, the ones set with vanilla's /tag <target> add <name>. It is the simplest way to let a command or a function switch a power on without making a resource for it.
Type ID: apoli:has_command_tag
Fields
| Field | Type | Default | Description |
|---|---|---|---|
command_tag | String | optional | A single tag to look for. |
command_tags | array of String | [] | Several tags. Passes if the entity has any of them. Combines with command_tag. |
With neither field set, it passes whenever the entity has any command tag at all.
Example
Grant flight only while a tag is present, so a command can turn it on and off:
{
"type": "apoli:creative_flight",
"condition": {
"type": "apoli:has_command_tag",
"command_tag": "mypack.flying"
}
}tag @s add mypack.flying
tag @s remove mypack.flyingSeveral tags, any of which counts:
{
"type": "apoli:has_command_tag",
"command_tags": ["mypack.vip", "mypack.staff"]
}