Skip to content

Triggers

EmakiSkills uses active triggers and passive triggers.

  • Active triggers are global slot triggers. Players bind skills to trigger slots in the GUI, then cast them while cast mode is enabled.
  • Passive triggers are declared in skill definitions through trigger_type: passive and passive_triggers.

Active triggers

TriggerOperation
left_clickLeft click.
right_clickRight click.
shift_left_clickShift + left click.
shift_right_clickShift + right click.
drop_qDrop key.
hotbar_1 ~ hotbar_9Number keys 1-9.

Active triggers are configured globally in config.yml under triggers:

yaml
triggers:
  right_click:
    display_name: "[Right Click]"
    enabled: true
    incompatible_with:
      - shift_right_click

Passive triggers

yaml
id: lifesteal_passive
trigger_type: passive
passive_triggers:
  - attack
cooldown_ticks: 60
TriggerWhen it fires
attackWhen the player hits an entity.
damagedWhen the player takes damage.
damaged_by_entityWhen the player is damaged by an entity.
deathWhen the player dies.
kill_entityWhen the player kills a non-player entity.
kill_playerWhen the player kills another player.
shoot_bowWhen the player shoots a bow.
arrow_hitWhen an arrow hits an entity.
arrow_landWhen an arrow lands without hitting an entity.
shoot_tridentWhen the player throws a trident.
trident_hitWhen a trident hits an entity.
trident_landWhen a trident lands.
break_blockWhen the player breaks a block.
place_blockWhen the player places a block.
drop_itemWhen the player drops an item.
shift_drop_itemShift + drop item.
swap_itemsSwap main hand and off hand.
shift_swap_itemsShift + swap hands.
loginPlayer login.
sneakSneak toggle.
teleportPlayer teleport.
timerPeriodic trigger.
combo_attackCombo attack trigger.

consume must be registered in config.yml yourself

The listener dispatches consume for PlayerItemConsumeEvent (eating or drinking), but consume is neither a built-in default trigger nor present in the bundled config.yml > passive_triggers. Unregistered triggers are dropped at dispatch time, so writing passive_triggers: [consume] alone has no effect and raises no error.

To enable it, add a section under config.yml > passive_triggers first:

yaml
passive_triggers:
  consume:
    display_name: "[Consume]"
    enabled: true
    incompatible_with: []

Cron passive trigger

When a skill definition sets cron_expression, a passive trigger with the ID cron_<skill id> is registered automatically and added to that skill's passive_triggers; you do not write it by hand. The expression uses the same 6-field Quartz format as spawn_rules. cron_max_executions caps the total number of firings; 0 means unlimited.

Passive trigger settings

yaml
passive_trigger_settings:
  timer_interval_ticks: 20
  combo_timeout_ticks: 60
FieldDescription
timer_interval_ticksCheck interval for the timer passive trigger.
combo_timeout_ticksTime before combo state resets.

Cast mode

Active skills require cast mode. By default, the F key toggles cast mode through the server-visible hand-swap action.

yaml
cast_mode:
  entry_key: "f"
  restore_last_state_on_join: true