Skip to content

Instantly share code, notes, and snippets.

@misode
Last active December 18, 2021 08:47
Show Gist options
  • Save misode/edff282c07eeb72dc45c84327ae11d66 to your computer and use it in GitHub Desktop.
Save misode/edff282c07eeb72dc45c84327ae11d66 to your computer and use it in GitHub Desktop.

Loot Context

Uses

Functions

  • looting_enchant: killer_entity
  • set_name only if entity is set: this_entity, killer_entity, direct_killer_entity, or last_damage_player
  • exploration_map: origin
  • copy_name depending on the value of source: this_entity, killer_entity, last_damage_player, or block_entity
  • apply_bonus: tool
  • explosion_decay: explosion_radius
  • set_lore only if entity is set: this_entity, killer_entity, direct_killer_entity, or last_damage_player
  • fill_player_head only if entity is set: this_entity, killer_entity, direct_killer_entity, or last_damage_player
  • copy_nbt with context type: this_entity, killer_entity, direct_killer_entity, last_damage_player, or block_entity
  • copy_state: block_state

Conditions

  • random_chance_with_looting: killer_entity
  • entity_properties depending on the value of entity: this_entity, killer_entity, direct_killer_entity, or last_damage_player. Secondly, only if the distance predicate is used: origin
  • killed_by_player: last_damage_player
  • entity_scores depending on the value of entity: this_entity, killer_entity, direct_killer_entity, or last_damage_player
  • block_state_property: block_state
  • match_tool: tool
  • table_bonus: tool
  • survives_explosion: explosion_radius
  • damage_source_properties: origin and damage_source
  • location_check: origin

Providers

  • score number provider with context type, depending on the value of target: this_entity, killer_entity, direct_killer_entity, or last_damage_player

Invocations

  • advancement_reward: Dropping loot as advancement reward
  • advancement_entity: Using conditions in an advancement
  • selector: Selector argument predicate=
  • command: /execute if predicate or applying an item modifier with /item
  • entity: /loot ... kill or an entity dying
  • chest: /loot ... loot or opening a minecart chest or container
  • fishing: /loot ... fish or retrieving a fishing hook
  • gift: Villager or cat gifting the player items
  • barter: Piglin bartering
  • block: Destroying a block
  • generic: Validating an item modifier or predicate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment