Skip to main content

Run Stored Power (Entity Action Type)

Fires a power held in an apoli:power_storage as though a key had been pressed on it. The stored power doesn't have to be granted, and it doesn't have to be bound to the key you name: whatever keybind it declares, this action runs it with the one you pass. A storage left on its defaults already gives the stored power its own keybind, so this action is for firing it from somewhere else. A storage with own_key: false makes this action the only way to fire it, which is what a mechanic for stealing abilities usually wants.

Type ID: apoli:run_stored_power

It fires the key-driven part of a stored power: apoli:action_on_key_press, apoli:toggle, apoli:fire_projectile and apoli:inventory. Their own cooldowns, conditions and activation packets all apply exactly as if the holder had pressed the key.

A stored apoli:multiple fires every key-driven sub-power it holds, each still gated by its own condition and cooldown, so a spell written as one bundle is stored and cast as one unit.

Fields

FieldTypeDefaultDescription
storageIdentifieroptionalOnly reads this storage power. Leave it out to search every apoli:power_storage the entity has.
keyKeyoptionalThe key to run as. Leave it out and the stored power fires whichever key it declares.
powerIdentifieroptionalOnly runs this stored power.
tagsString or listoptionalOnly runs stored powers carrying one of these tags.
indexInteger-1Only runs the stored power at this position, counting from the oldest. -1 turns the position filter off.
allBooleanfalseRuns every match instead of stopping after the first one that fires.

Examples

Cast whatever is in the book when the player presses their primary key:

{
  "type": "apoli:action_on_key_press",
  "key": { "key": "key.apoli.primary" },
  "entity_action": {
    "type": "apoli:run_stored_power",
    "storage": "example:spell_book",
    "key": { "key": "key.apoli.primary" }
  }
}

Fire only the spell tagged fire in slot 0, whatever key the stored power declares:

{
  "type": "apoli:run_stored_power",
  "storage": "example:spell_book",
  "index": 0,
  "tags": "fire"
}

Run everything in the book at once:

{
  "type": "apoli:run_stored_power",
  "all": true
}
note

When key is set, apoli:prevent_key_press can still block the cast, the same as a real press of that key. Leave key out and nothing can block it.

A stored power that isn't key-driven gives this action nothing to run, and a stored power's own condition and cooldown still apply. With /apoli:dev_mode on, a cast that does nothing says whether the storage was empty, whether the filters matched nothing, or whether something matched and refused to fire.