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
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 | mythicmobs | Run only the MythicMobs skill from mythic_skill. |
hybrid | both | Run both native script and MythicMobs skill. |
An unrecognized mode falls back to script_engine.default_mode.
Phases
| Phase | When it runs |
|---|---|
cast | When the skill is cast. |
hit | When the skill hits a target. |
miss | When the skill misses. |
fail | When casting fails. |
Phase keys accept only the names above; prefixed forms such as on_cast are not supported.
The script block also accepts an enabled field. When it is not set explicitly, the script counts as enabled if any phase exists under actions.
Example
id: flame_strike
trigger_type: active
display_name: '<red>Flame Strike'
script:
mode: native
stop_on_failure: true
actions:
cast:
- '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:
- 'ignite ticks=60'
- 'message text="<red>Burning!"'
fail:
- '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:
actions:
- '@if="%has_target% == 1" damage amount=20'
- '@chance=30% ignite ticks=100'
- '@delay=20 message text="<gray>Fires one second later."'| Prefix | Description |
|---|---|
@if='%expr%' | Run only when the expression is true. An invalid expression fails the line. |
@chance=%n%% | Run with the given probability. A miss marks the line as skipped. |
@delay=<time> | Delay the line by the given time. Accepts ms, s, and t suffixes; a bare number is parsed as ticks. |
Modifiers are evaluated in the order @if → @chance → @delay, so a line that fails the condition or the chance roll is skipped without waiting for the delay.
Skill variables
variables define runtime values that can be referenced by action lines, conditions, and text with %variable% syntax:
variables:
fire_damage:
type: expression
value: "10 + %level% * 5"
is_enhanced:
type: boolean
value: "%level% >= 5"