On Spell Cast Cancel

Description

Fires when a player's active cast is cancelled before it completes — the player moved (CancelOnMove), took damage (CancelOnDamage), interacted with a block / entity (CancelOnInteraction), the cancelCast mechanic was applied, the spell's FINISH-time usability or reagent check failed, the player died, or the player logged out.

When the cancellation specifically came from the interrupt mechanic, ~onSpellCastInterrupt fires instead of this one.

Trigger Variables

All variables from ~onSpellCastStart, plus:

Variable Type Description
<skill.var.cast-cancel-reason> string One of cancelled, moved, damaged, interacted, interrupted, replaced, failed, death, quit, profile_unloaded

Examples

Apply a small mana refund and a "fizzle" sound on cancellation:

fireball:
  Spell: true
  CastTime: 2s
  Cost:
  - mana 60
  Skills:
  - sound{s=block.fire.extinguish} @self ~onSpellCastCancel
  - projectile{...}

Aliases

  • ~onCastCancel
Updated Aug 19, 2026