Triggers
Triggers let a vanilla node or a category entry unlock automatically when a player meets a gameplay condition, without a command or API grant. Whether they run at all is controlled by config.yml > advancement.triggers_enabled, documented in Configuration.
Both places share the same event and condition syntax but land in different systems:
| Location | Key | Effect on match |
|---|---|---|
advancements/*.yml node | triggers.entries | Completes the vanilla advancement and runs actions.complete |
codex/*.yml entry | unlock.triggers | Moves the category entry to unlocked, without activating or claiming |
For the page and node fields, see Advancements; for category-entry fields, see Configuration and Category GUI.
triggers.entries
Vanilla node triggers are defined under a node:
triggers:
entries:
- event: "craft_item"
condition:
type: "all_of"
entries:
- '%result_type% == "CRAFTING_TABLE"'Fields:
| Field | Type | Description |
|---|---|---|
event | string | Trigger type, normalized as a CoreLib ID. |
condition | CoreLib condition group | Optional. If omitted, the event grants the node whenever it fires. |
A node may have multiple triggers; any matching trigger can grant the node.
unlock.triggers
Category-entry triggers are defined under the entry's unlock block, using exactly the same event and condition syntax:
entries:
master_miner:
unlock:
triggers:
- event: "block_break"
condition:
type: "all_of"
entries:
- '%block_type% == "DIAMOND_ORE"'
advancements:
- "emakicodex:example/first_step"unlock.triggers and unlock.advancements are parallel paths; either one unlocks the entry. A match changes only the unlocked state: attribute rewards require a left-click activation in the GUI, and one-time rewards require a right-click claim.
Available triggers
For the complete shared event ID reference, see CoreLib Gameplay Event IDs. This page lists variables commonly used by both EmakiCodex trigger systems.
| event | Scenario | Variables |
|---|---|---|
entity_kill | Kill a normal entity | %entity_type% |
mythic_mob_kill | Kill a MythicMobs mob | %mythic_id%, %mythic_level% |
block_break | Break a block | %block_type% |
crop_harvest | Break a mature crop | %block_type% |
craft_item | Craft an item | %result_type%, %result_amount% |
furnace_extract | Extract a furnace result | %result_type%, %result_amount% |
player_fish | Fishing event | %fish_state% |
brew_complete | Brewing completes | %potion_type% |
entity_tame | Tame an entity | %entity_type% |
Every trigger also provides:
| Variable | Description |
|---|---|
%player% | Player name. |
%world% | Player world name. |
Trigger conditions first replace event variables, then resolve remaining PlaceholderAPI placeholders when PlaceholderAPI is installed.
Condition examples
Kill an Ender Dragon or Wither:
triggers:
entries:
- event: "entity_kill"
condition:
type: "any_of"
entries:
- '%entity_type% == "ENDER_DRAGON"'
- '%entity_type% == "WITHER"'Craft at least 16 target items:
triggers:
entries:
- event: "craft_item"
condition:
type: "all_of"
entries:
- '%result_type% == "DIAMOND_BLOCK"'
- '%result_amount% >= 16'Kill a specific MythicMobs mob:
triggers:
entries:
- event: "mythic_mob_kill"
condition:
type: "all_of"
entries:
- '%mythic_id% == "ancient_guardian"'
- '%mythic_level% >= 10'The examples above use a vanilla node's triggers.entries. To use them for a category entry, place the same list under the entry's unlock.triggers.
Related Pages
- Advancements: node fields and
actions.complete. - Category GUI: the four-state flow and reward interactions after
unlock.triggersmatches. - Configuration: the
advancement.triggers_enabledswitch and category-entry fields. - Gameplay Event IDs: the complete event list on the CoreLib side.