Skip to content

Instantly share code, notes, and snippets.

@misode
Last active October 10, 2019 19:52
Show Gist options
  • Save misode/92a09d4f53d47d90ecdca6c5a6fefb60 to your computer and use it in GitHub Desktop.
Save misode/92a09d4f53d47d90ecdca6c5a6fefb60 to your computer and use it in GitHub Desktop.

General Structure

{
  "trigger": string // one of the triggers mentioned below
  "predicate": {
    // trigger-specific properties
  },
  "actions": [
    {
      "action": string // one of "function", "advancement", ...
      "context": string //one of "this", "killer", "victim", ...
    }
  ]
}

Triggers

List of triggers and their properties. Some of these are the same as advancements triggers.

  • use or attack: Triggered when a player uses or attacks with an item <- bred_animals, cured_zombie_villager, filled_bucket, slept_in_bed, used_ender_eye, used_totem
    • item: The item that the player used
    • entity: The player that triggered the event
    • duration: The minimum duration that the player has to hold the use button
    • victim: In case the target was an entity
    • block: In case the target was a block
  • place_block: Triggered when a player places a block <- placed_block
    • item: The item that was placed
    • block: The resulting block that was placed
    • entity: The player that placed the block
    • location: The location of the block
  • break_block: Triggered when a player breaks a block
    • block: The block that was broken
    • tool: The item used to break the block
    • entity: The player that broke the block
    • location: The location of the block
  • hurt_entity or kill_entity: Triggered when an entity got hurt <- entity_hurt_player, player_hurt_entity, killed_by_crossbow
    • attacker: The entity that attacked an entity
    • victim: The entity that got hurt by an entity
    • damage: The damage properties
  • inventory_changed
  • dimension_changed
  • enter_block
  • ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment