Skip to content

Triggers

Triggers let a node complete 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.

For the page and node fields, see Advancements.

triggers.entries

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.

Available triggers

For the complete shared event ID reference, see CoreLib Gameplay Event IDs. This page lists variables commonly used by EmakiCodex advancement triggers.

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'