Skill Triggers
The skills section in a mob definition binds lifecycle trigger events to CoreLib action pipelines. Requires EmakiSkills to be installed.
Trigger list
| Trigger | When it fires | Key context variables |
|---|---|---|
on_spawn | Mob spawned (fired immediately in MobFactory) | self |
on_death | Mob dies | self, killer (may be null) |
on_target | Mob acquires a new target | self, target |
on_damage_give | Mob deals damage to its target | self, target, damage |
on_damage_take | Mob receives damage | self, attacker (may be null), damage |
on_kill | Mob kills an entity | self, victim |
on_shoot | Mob fires a projectile | self |
on_explode | Mob explodes (e.g. Creeper) | self |
on_teleport | Mob teleports | self |
on_transform | Mob transforms (e.g. zombie → drowned) | self |
Action string format
Each trigger maps to a list of CoreLib action pipeline strings:
[selector |] action_name [key=value ...]Common selectors
| Selector | Description |
|---|---|
self | The mob that fired the event |
target | The target entity for this event |
killer | Player who killed the mob (on_death) |
victim | Entity killed by this mob (on_kill) |
attacker | Entity that damaged this mob (on_damage_take) |
nearby radius=<n> type=player | All players within radius blocks |
Action examples
yaml
skills:
on_spawn:
# Send a message to all players within 20 blocks
- "nearby radius=20 type=player | send_message text='<red>Elite Zombie has arrived!'"
# Spawn particles at the mob's location
- "self | spawn_particle particle=FLAME count=30 offset_x=0 offset_y=1 offset_z=0"
on_death:
# Give experience to the killer
- "killer | give_exp amount=80"
# Broadcast defeat message to nearby players
- "nearby radius=50 type=player | send_message text='<green>Elite Zombie defeated!'"
on_damage_give:
# Apply slowness to the target
- "target | give_potion_effect type=SLOWNESS level=1 duration=3s"
on_damage_take:
# Spawn flame particles when hurt
- "self | spawn_particle particle=FLAME count=10 offset_x=0 offset_y=1 offset_z=0"
on_target:
# Play a sound when acquiring a target
- "self | play_sound sound=minecraft:entity.skeleton.ambient volume=1.0 pitch=0.7"NOTE
The full list of available actions and their parameter syntax is provided by EmakiCoreLib. Refer to the CoreLib documentation for all supported actions.