Native Script System
EmakiSkills includes a native script system in addition to MythicMobs casting. Native scripts define effects directly in skill configuration and do not require external plugins.
Global script engine configuration
yaml
script_engine:
enabled: true
default_mode: "native"
stop_on_failure: true
max_lines_per_phase: 64
max_targets_per_action: 16
debug: false| Field | Description |
|---|---|
enabled | Whether native skill scripts are enabled. |
default_mode | Default mode when a skill does not declare one. |
stop_on_failure | Whether later actions stop after a failed action. |
max_lines_per_phase | Maximum action lines in one phase. |
max_targets_per_action | Maximum targets one action may process. |
debug | Whether script debug output is enabled. |
Script modes
| Mode | Alias | Description |
|---|---|---|
native | — | Run only built-in script actions. |
mythic | — | Run only the MythicMobs skill from mythic_skill. |
hybrid | both | Run both native script and MythicMobs skill. |
Phases
| Phase | Alias | When it runs |
|---|---|---|
cast | on_cast | When the skill is cast. |
hit | on_hit | When the skill hits a target. |
miss | on_miss | When the skill misses. |
fail | on_fail | When casting fails. |
Example
yaml
id: flame_strike
trigger_type: active
display_name: '<red>Flame Strike'
script:
mode: native
stop_on_failure: true
cast:
actions:
- 'sound sound=ENTITY_BLAZE_SHOOT volume=1 pitch=1.5'
- 'particle particle=FLAME at=target count=20 speed=0.1'
- 'damage amount=%fire_damage% damage_type=spell'
hit:
actions:
- 'ignite ticks=60'
- 'message text="<red>Burning!"'
fail:
actions:
- 'message text="<gray>Skill failed."'Context variables
Common variables include %level%, %skill_id%, %trigger_id%, %has_target%, %target_name%, %target_uuid%, %target_world%, %target_x%, %target_y%, and %target_z%.
Built-in actions
| Action | Purpose |
|---|---|
damage | Deal damage to a target. |
heal | Heal a target. |
ignite | Set a target on fire. |
message | Send MiniMessage text. |
sound | Play a sound. |
particle | Spawn particles. |
ray | Ray trace and store the result in shared state. |
aoe_damage | Deal damage to entities in an area. |
projectile | Launch a custom projectile with tick-by-tick simulation. |
mythic | Cast a MythicMobs skill. |
aoe_damage
Deal damage to entities in an area. Writes aoe_hit_count to shared state.
| Parameter | Required | Default | Description |
|---|---|---|---|
amount | Yes | — | Damage amount. |
radius | No | 5 | Area radius in blocks. |
center | No | target | Center point: caster, target, or look. |
shape | No | sphere | Area shape: sphere or cylinder. |
filter | No | hostile | Target filter: hostile (excludes players) or all. |
max_targets | No | 20 | Maximum hit count. |
exclude_caster | No | true | Whether to exclude the caster. |
projectile
Launch a custom projectile with tick-by-tick simulation. Sets the context target entity on hit.
| Parameter | Required | Default | Description |
|---|---|---|---|
speed | No | 1.5 | Blocks per tick. |
gravity | No | 0.05 | Gravity per tick. |
lifetime | No | 60 | Max lifetime in ticks. |
hit_radius | No | 0.5 | Hit detection radius. |
pierce | No | 0 | Number of entities to pierce through. |
homing | No | false | Enable homing toward target. |
homing_strength | No | 0.1 | Homing turn strength. |
particle | No | FLAME | Trail particle type. |
damage | No | 0 | Damage on hit (0 = no damage). |
direction | No | look | Initial direction: look or target. |
Actions can use modifiers:
yaml
actions:
- '@if="%has_target% == 1" damage amount=20'
- '@chance=30% ignite ticks=100'Skill variables
variables define runtime values that can be referenced by action lines:
yaml
variables:
fire_damage:
type: expression
value: "10 + %level% * 5"
is_enhanced:
type: boolean
value: "%level% >= 5"