Skip to content

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:

LocationKeyEffect on match
advancements/*.yml nodetriggers.entriesCompletes the vanilla advancement and runs actions.complete
codex/*.yml entryunlock.triggersMoves 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:

yaml
triggers:
  entries:
    - event: "craft_item"
      condition:
        type: "all_of"
        entries:
          - '%result_type% == "CRAFTING_TABLE"'

Fields:

FieldTypeDescription
eventstringTrigger type, normalized as a CoreLib ID.
conditionCoreLib condition groupOptional. 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:

yaml
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.

eventScenarioVariables
entity_killKill a normal entity%entity_type%
mythic_mob_killKill a MythicMobs mob%mythic_id%, %mythic_level%
block_breakBreak a block%block_type%
crop_harvestBreak a mature crop%block_type%
craft_itemCraft an item%result_type%, %result_amount%
furnace_extractExtract a furnace result%result_type%, %result_amount%
player_fishFishing event%fish_state%
brew_completeBrewing completes%potion_type%
entity_tameTame an entity%entity_type%

Every trigger also provides:

VariableDescription
%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:

yaml
triggers:
  entries:
    - event: "entity_kill"
      condition:
        type: "any_of"
        entries:
          - '%entity_type% == "ENDER_DRAGON"'
          - '%entity_type% == "WITHER"'

Craft at least 16 target items:

yaml
triggers:
  entries:
    - event: "craft_item"
      condition:
        type: "all_of"
        entries:
          - '%result_type% == "DIAMOND_BLOCK"'
          - '%result_amount% >= 16'

Kill a specific MythicMobs mob:

yaml
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.

  • Advancements: node fields and actions.complete.
  • Category GUI: the four-state flow and reward interactions after unlock.triggers matches.
  • Configuration: the advancement.triggers_enabled switch and category-entry fields.
  • Gameplay Event IDs: the complete event list on the CoreLib side.