Spell Handler
Comprehensive spell casting system with cooldowns, charges, warmup, and channeling.Spell
Main spell execution handler.Unique spell identifier
Display name for the spell
Spell category/type for classification
Base damage value
Cooldown duration in seconds
Warmup/cast time in seconds
Number of charges (0 = no charge system)
Time to regenerate one charge in seconds
Delay before charge regeneration starts
Critical hit chance (0.0-1.0)
Critical damage multiplier bonus
Show cooldown messages
Enable debug output
Spell Lifecycle Hooks
Executed when channeling begins
Executed each tick during channeling
Executed when spell is cast
Executed on any interrupt
Executed on forced interrupt (stun, etc)
Executed on manual interrupt (player cancel)
Executed when cast while on cooldown
Executed when cooldown expires
Channeling System
spell-channel Handles spell warmup/casting time.- Creates terminable aura with
type=channel - Shows boss bar with cast progress
- Summons channel_indicator display entity
- Checks for interrupts (force_interrupt, manual_interrupt)
- Sets
caster.cast_fatigueafter successful cast
Set to true to force interrupt (e.g., stun)
Set to true for manual interrupt (e.g., casting another spell)
Charge System
spell-charges-cast Handles spells with multiple charges.- Tracks charges in
caster.<id>-charges - Decrements charge on cast
- Initiates recharge delay
- Regenerates charges over time
- Only runs when charges < max_charges
- Shows boss bar with charge count and timer
- Calls itself recursively until full
Cooldown Management
spell-cooldown Applies cooldown aura.- Creates aura with
type=cooldown - Updates
caster.<id>-cdvariable each tick - Shows boss bar with cooldown timer
- Triggers
spell-cooldown_endon expiration
- Removes cooldown aura
- Triggers
COOLDOWN_RESETmodifier event - Clears cooldown variable
Modifier Handler
Dynamic modifier system for stacking buffs/debuffs.modifier
Adds a modifier to the caster.Unique name for this modifier
Operation/skill to execute
Trigger event:
PRECAST, CAST, DAMAGE, PRE_DAMAGE, COOLDOWN_END, CRITICAL_DAMAGE, WEAPON_HIT, ABILITY_HITExecution priority (1-7, higher = earlier)
- 1: LOWEST
- 2: LOW
- 3: MEDIUM
- 4: HIGH
- 5: SPELL SELECT
- 6: SPELL EXECUTION
- 7: MONITOR
Stack count for the modifier
modifier-trigger
Executes all modifiers for a trigger event.Trigger event to execute
Force update of modifier list
modifier-remove
Removes modifiers by name.Name of modifier to remove
modifier-clear
Removes all modifiers from caster.Example
Damage Core
Advanced damage system with hit tracking and modifiers.damage
Standard damage skill.Damage amount
Source of damage (for modifiers)
Type of damage (defaults to damage_source)
Immunity ticks after hit
Identifier for hit tracking
Skill to modify damage before applying
Skill executed before damage
Skill executed after damage
damage-weapon
Weapon damage with WEAPON tag.- Same parameters as
damage - Triggers
WEAPON_HITmodifier event - Tags damage as
tag=WEAPON
damage-ability
Ability damage with stagger effect.- Same parameters as
damage - Applies suspension and stagger
- Triggers
ABILITY_HITmodifier event - Tags damage as
tag=ABILITY
Hit Tracking
Variables:List of UUID strings for entities hit by this skill
Number of entities hit
UUID of current target
Damage Indicator
damage_indicator Displays floating damage numbers.- Creates text display projectile
- Scales based on damage percent
- Flies toward caster with drag
- Uses
<placeholder.damage_text>for formatting
Knockback Core
Advanced knockback system with directional control.knockback
Applies knockback to entities.Horizontal knockback velocity
Vertical knockback velocity
Origin point for knockback direction
Apply vertical component
Variables
Direction target for knockback (set with setvarloc)
Example
Melee Core
Melee combat system with moveset integration.Melee
Main melee handler.Base melee damage (defaults to caster.damage)
- Sweep: Normal hit (moveset index 1)
- Weak: Weak attack (attack cooldown < 0.9)
- Sprint: Sprint attack
- Critical: Critical hit
- Uppercut: Crouching hit
- Aerial: Air attack
Knockback Types
knockback-melee_weak- kb=1.25, kby=0.75 (ground)
- kb=1.25, kby=-0.75 (air)
- kb=1.5, kby=0.75 (ground)
- kb=1.5, kby=-0.75 (air)
- Same as weak but with crit sound
- kb=1.25, kby=1.6 (launches upward)
Mana Charge
Mana charge/resource system.mana_charge
Adds or removes mana charge.Mana to add (positive) or remove (negative)
Variables
Current mana charge
Maximum mana charge
Mana decay per tick (10% of max per second)
mana_charge-decay
Automatic mana decay system.- Decays when not channeling
- Removes mana_charged aura when depleted
- Updates action bar display
Other Handlers
setRandomID
Generates random ID for hit tracking.summon_handler
Initializes summoned entities.- Sets owner UUID and name
- Sets parent relationship
- Initializes combat state
- Updates name display
spell_cast-defaults
Default stat mapping for spells. stat_map-default Sets up default spell parameters:- spell_power, damage, critical stats
- mana costs, charges
- warmup, cooldowns
- velocity, spread, range, radius
- knockback_modifier, status_duration
- channel-start_fx: Sound effects for channeling
- channel-tick_fx: Particle effects during channel
- channel-cast_fx: Cast completion effects