Overview
In this guide, you’ll create a simple fire projectile spell using the spell handler system. The spell will:- Launch a flaming projectile that tracks targets
- Ignite enemies on hit
- Deal critical damage to already burning enemies
- Have 3 charges that regenerate over time
flame_flicker demo spell included in the pack.
Understanding the Spell System
The modular spell system uses a handler-based architecture where you wrap your custom skill logic with theSpell handler. The handler automatically manages:
- Cooldowns and charge systems
- Warmup/channeling mechanics
- Stat calculations (damage, crit chance, etc.)
- Player feedback (sounds, messages, action bar displays)
Every spell needs at least two skills: a cast skill that calls the Spell handler, and an execution skill that contains your actual spell logic.
Creating Your First Spell
Create the Cast Skill
The cast skill is what players will trigger (via item, command, or mechanic). It calls the Parameter breakdown:
Spell handler with your spell’s configuration.Create a new file in your skills folder called my_fireball-spell.yml:my_fireball-spell.yml
id- The skill to execute when the spell is castname- Display name shown to playerstype- Spell categories (used for modifiers and filtering)spellcd- Base cooldown in seconds (0 = no cooldown)charges- Number of charges (0 = no charge system)chargecd- Time to regenerate one chargecharge_delay- Delay before first charge starts regeneratingcharge_regen- Number of charges restored per cycle
Create the Execution Skill
The execution skill contains your spell’s actual behavior. It’s called after the Spell handler validates cooldowns and charges.Add this to the same file:This launches the projectile slightly in front of and below the player’s eye level, targeting 12 blocks ahead.
my_fireball-spell.yml
Create the Projectile Skill
Now we’ll create the actual projectile that fires:Key parameters:
my_fireball-spell.yml
velocity=64- Fast projectile speedmr=12- Max range of 12 blockshr=0.4;vr=0.4- Hit radius (horizontal and vertical)onTick- Called every tick while projectile travelsonHit- Called when hitting an entityonEnd- Called when projectile reaches max range or hits block
Add Visual Effects
Create the tick skill that displays particle effects as the projectile travels:This creates a flickering flame trail with slight randomization for a more natural look.
my_fireball-spell.yml
Add Damage on Hit
Create the hit skill that damages enemies and applies effects:This deals 60% of base damage and ignites the target for 3 seconds (60 ticks). If the target is already burning, it triggers the critical hit version instead.Now add the critical hit version:Critical hits deal 150% damage and ignite for 10 seconds (200 ticks).
my_fireball-spell.yml
my_fireball-spell.yml
Add End Effects (Optional)
Add visual and sound effects when the projectile expires:
my_fireball-spell.yml
Complete Code
Understanding Spell Parameters
TheSpell handler accepts many configuration parameters. Here are the most commonly used:
Basic Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
id | string | required | The skill to execute when cast |
name | string | required | Display name for the spell |
type | string | ”ABILITY” | Spell category/tags (comma-separated) |
spellcd | float | 1 | Base cooldown in seconds |
damage | float | caster.damage | Base damage value |
Charge System
| Parameter | Type | Default | Description |
|---|---|---|---|
charges | int | 0 | Max charges (0 disables charge system) |
chargecd | float | 3 | Seconds to regenerate one charge |
charge_regen | int | 1 | Charges restored per cycle |
charge_delay | float | 0 | Delay before first charge regens |
Warmup/Channeling
| Parameter | Type | Default | Description |
|---|---|---|---|
warmup | float | 0 | Channel time in seconds before cast |
onChannelStart | skill | channel-start_fx | Skill called when channeling starts |
onChannelTick | skill | channel-tick_fx | Skill called each tick while channeling |
onInterrupt | skill | [] | Skill called when channel is interrupted |
Advanced Stats
| Parameter | Type | Default | Description |
|---|---|---|---|
critical_chance | float | 0.01 | Chance to crit (0-1) |
critical_damage | float | 0 | Bonus crit damage multiplier |
velocity | float | 48 | Projectile velocity |
range | float | 32 | Max spell range |
Next Steps
Now that you’ve created your first spell, you can:- Explore the demo spells in
skills/Demo Skills/Demo Spells/for more examples - Learn about the damage system and modifiers
- Create custom visual effects with particles
- Build spell combos and interactions
- Implement mana costs and resource management
Check out the
burning_blast-spell.yml demo for an advanced example featuring warmup channeling, dynamic retargeting, and explosive area damage.