Skip to content

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
FieldDescription
enabledWhether native skill scripts are enabled.
default_modeDefault mode when a skill does not declare one.
stop_on_failureWhether later actions stop after a failed action.
max_lines_per_phaseMaximum action lines in one phase.
max_targets_per_actionMaximum targets one action may process.
debugWhether script debug output is enabled.

Script modes

ModeAliasDescription
nativeRun only built-in script actions.
mythicRun only the MythicMobs skill from mythic_skill.
hybridbothRun both native script and MythicMobs skill.

Phases

PhaseAliasWhen it runs
caston_castWhen the skill is cast.
hiton_hitWhen the skill hits a target.
misson_missWhen the skill misses.
failon_failWhen 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

ActionPurpose
damageDeal damage to a target.
healHeal a target.
igniteSet a target on fire.
messageSend MiniMessage text.
soundPlay a sound.
particleSpawn particles.
rayRay trace and store the result in shared state.
aoe_damageDeal damage to entities in an area.
projectileLaunch a custom projectile with tick-by-tick simulation.
mythicCast a MythicMobs skill.

aoe_damage

Deal damage to entities in an area. Writes aoe_hit_count to shared state.

ParameterRequiredDefaultDescription
amountYesDamage amount.
radiusNo5Area radius in blocks.
centerNotargetCenter point: caster, target, or look.
shapeNosphereArea shape: sphere or cylinder.
filterNohostileTarget filter: hostile (excludes players) or all.
max_targetsNo20Maximum hit count.
exclude_casterNotrueWhether to exclude the caster.

projectile

Launch a custom projectile with tick-by-tick simulation. Sets the context target entity on hit.

ParameterRequiredDefaultDescription
speedNo1.5Blocks per tick.
gravityNo0.05Gravity per tick.
lifetimeNo60Max lifetime in ticks.
hit_radiusNo0.5Hit detection radius.
pierceNo0Number of entities to pierce through.
homingNofalseEnable homing toward target.
homing_strengthNo0.1Homing turn strength.
particleNoFLAMETrail particle type.
damageNo0Damage on hit (0 = no damage).
directionNolookInitial 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"