Skills Overview
The Skills system lets you define reactive behaviors using a simple action-target-trigger syntax.
Syntax
action{params} @target{params} ~trigger{params}
| Component | Prefix | Required | Description |
|---|---|---|---|
| Action | (none) | Yes | What to do |
| Target | @ | No | Who it affects (default: @Self) |
| Trigger | ~ | Yes | When it happens |
Quick Example
Skills:
# Play idle animation while idle
- animation{name=idle, mode=loop} ~idle
# Play walk animation while moving
- animation{name=walk, mode=loop} ~moving
# Deal explosion damage to nearby players on death
- damage{amount=10, type=explosion} @PlayersInRadius{r=5} ~onDeath
Components
Actions
What happens when the skill activates.
| Action | Description |
|---|---|
| animation | Play an animation |
| damage | Deal damage |
| hidebone | Hide a bone |
| showbone | Show a bone |
Targets
Who the action affects.
| Target | Description |
|---|---|
| @Self | The entity itself (default) |
| @Attacker | Entity that last attacked |
| @PlayersInRadius | Players within range |
Triggers
When the skill activates.
Lifecycle triggers:
| Trigger | Description |
|---|---|
| ~onSpawn | When entity spawns |
| ~onDeath | When entity dies |
| ~onLoad | When entity loads from save |
| ~onDespawn | When entity is removed (not death) |
Combat triggers:
| Trigger | Description |
|---|---|
| ~onHurt | When entity takes damage |
| ~onAttack | When entity attacks |
| ~onKill | When entity kills something |
| ~onEnterCombat | When entering combat |
| ~onDropCombat | When leaving combat |
| ~onTargetChange | When target changes |
| ~onShoot | When firing ranged attack |
| ~onExplode | When exploding (creeper-like) |
Utility triggers:
| Trigger | Description |
|---|---|
| ~onTimer | Periodic execution |
| ~onInteract | When player right-clicks |
| ~onSignal | When receiving a signal |
State triggers (active while condition is true):
| Trigger | Description |
|---|---|
| ~idle | While not moving |
| ~moving | While moving |
| ~health | Based on health % |
Pet triggers (require Taming):
| Trigger | Description |
|---|---|
| ~tamed / ~untamed / ~sitting | Pet state triggers |
Skill Order
Skills are evaluated in order. For state triggers (like ~idle and ~moving), the first matching animation wins.
Skills:
# These are mutually exclusive - order matters
- animation{name=run, mode=loop} ~moving{speed=0.3} # Fast movement
- animation{name=walk, mode=loop} ~moving # Normal movement
- animation{name=idle, mode=loop} ~idle # Standing still
Common Patterns
Basic Animation Set
Skills:
- animation{name=idle, mode=loop} ~idle
- animation{name=walk, mode=loop} ~moving
- animation{name=hurt} ~onHurt
- animation{name=death} ~onDeath
Boss with Phases
Skills:
- animation{name=idle, mode=loop} ~idle
- animation{name=walk, mode=loop} ~moving
- animation{name=enrage} ~health{below=50, once=true}
- showbone{bone=phase2_effects} ~health{below=50, once=true}
- damage{amount=15, type=fire} @PlayersInRadius{r=8} ~onDeath
Counter-Attack
Skills:
- damage{amount=3, type=magic} @Attacker ~onHurt