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:
- 'self | play_sound sound=ENTITY_BLAZE_SHOOT volume=1 pitch=1.5'
- 'trigger | spawn_particle particle=FLAME count=20'
- 'trigger | damage amount=%fire_damage%'
hit:
- 'trigger | ignite duration=3s'
- 'self | send_message text="<red>Burning!"'
fail:
- 'self | send_message text="<gray>Skill failed."'Context variables
Script execution injects %level%, %skill_id%, %trigger_id% and %has_target% (0 or 1), plus five synonyms for MythicMobs to read: %emaki_skill_id%, %emaki_skill_level%, %emaki_trigger_id%, %emaki_is_passive% and %emaki_has_target%.
Expressions inside a variables block may additionally reference %max_level%, %is_passive%, %player_level%, %player_health%, %player_max_health% and %sneaking%. These take part in variable evaluation only; they are not injected as script-line placeholders.
Script actions
Script lines are compiled and executed by CoreLib's action engine, so the available action stages are exactly those in the CoreLib registry plus the skill stages EmakiSkills registers. EmakiSkills has no separate private action IDs.
- The full list of CoreLib's own stages and their parameters is in CoreLib Actions.
- The stages EmakiSkills adds (
cast_skill,cast_mythic_skill, level/slot/cooldown/unlock) are in CoreLib Actions.
Use the registered stage IDs
A stage ID must match its registered name exactly. A line with a wrong ID is dropped at compile time and recorded as a diagnostic; it does not fail at runtime. Common mistakes:
| Wrong | Correct |
|---|---|
message | send_message |
sound | play_sound |
particle | spawn_particle |
mythic | cast_mythic_skill |
ray and aoe_damage are not registered stages and have no equivalent.
Targets are not selected through an action parameter but with the pipeline's source | stage syntax. Sources commonly used in skill scripts are self, trigger (the entity named by the trigger context), looking_at, nearby, nearby_players, and player_by_name.
| Action | Purpose | Parameters |
|---|---|---|
damage | Deal damage to a target. | amount (required) |
heal | Heal a target. | amount (required) |
ignite | Set a target on fire. | duration (default 5s) |
send_message | Send MiniMessage text. | text (required) |
play_sound | Play a sound. | sound (required), volume, pitch |
spawn_particle | Spawn particles. | particle (required), count, offset_x, offset_y, offset_z, extra |
projectile | Launch a custom projectile with tick-by-tick simulation. | See below |
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. |
Conditions, chance, and delay
Conditions, chance rolls, and delays are gate stages placed between pipes, not line-leading @ prefixes:
actions:
cast:
- 'trigger | where %has_target%==1 | damage amount=20'
- 'trigger | chance 30% | ignite duration=5s'
- 'self | after 20t | send_message text="<gray>Fires one second later."'| Gate | Description |
|---|---|
where <condition> | Clears the target stream when the condition is false, so later stages do not run. |
chance <n>% | Passes with the given probability. |
after <time> | Delays the following stages. Accepts ms, s, and t suffixes. |
The @ prefix form is obsolete
The old line-leading @if=, @chance= and @delay= prefixes are no longer parsed. The replacements are @chance=25% → chance 25%, @delay=20t → after 20t, and @if=<condition> → an if <condition> [ ... ] branch or where <condition>. @ignore_failure has no equivalent. Full syntax is in CoreLib Actions.
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"