Skip to main content

Prevent Powers (Power Type)

Suppresses the listed powers for as long as this power is active. A suppressed power does nothing: it doesn't tick or apply, and its conditions aren't evaluated. The entity still holds it, so it comes straight back when this power stops applying.

That makes apoli:prevent_powers the right tool for a temporary lockout, because revoking a power and granting it again would lose its state.

Type ID: apoli:prevent_powers

Fields

FieldTypeDefaultDescription
powersArray of IdentifierrequiredThe IDs of the powers to suppress.
update_rateInteger5How often, in ticks, this power checks its own condition again. Raise it if the condition is expensive and doesn't need to be exact.

Examples

Lose your abilities in water:

{
  "type": "apoli:prevent_powers",
  "powers": [
    "mypack:fire_breath",
    "mypack:heat_aura"
  ],
  "condition": {
    "type": "apoli:submerged_in",
    "fluid": "minecraft:water"
  }
}

A silence effect driven by a resource, checked every tick so it takes effect immediately:

{
  "type": "apoli:prevent_powers",
  "powers": ["mypack:blink", "mypack:shockwave"],
  "update_rate": 1,
  "condition": {
    "type": "apoli:resource",
    "resource": "mypack:silence",
    "comparison": ">",
    "compare_to": 0
  }
}
note

Suppression is tracked by source, so several powers can suppress the same power, and it stays suppressed until all of them stop. To suppress a power from a command or an action, use apoli:suppress_power.