Skip to main content

Power (Entity Condition Type)

Checks whether the entity has a given power, or any power that carries one of the given tags. It is mostly used for origin conditions in layers.

Type ID: apoli:power

Fields

FieldTypeDefaultDescription
powerIdentifieroptionalThe ID of the power the entity must have.
tagsString or Array of StringsoptionalPasses if the entity has any power carrying one of these tags.
sourceIdentifieroptionalThe matching power must also come from this power source.

Give power, tags or both. A condition with neither fails to load, and the log names the power it is in. With both, the condition passes when either one matches.

Examples

"condition": {
    "type": "apoli:power",
    "power": "origins:damage_from_potions"
}

This checks whether the player has the origins:damage_from_potions power from their origin.

"condition": {
    "type": "apoli:power",
    "tags": ["example.water_breathing", "example.amphibious"],
    "source": "origins:origin"
}

This passes while the entity holds any power tagged example.water_breathing or example.amphibious that its origin granted, without listing the powers themselves.

note

The list of powers carrying each tag is built once when data packs load, so a tag check costs one lookup per power that carries the tag, and it doesn't walk every power the entity has.