Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Minecraft:Loot context

From SAS Gaming Wiki
Revision as of 11:50, 20 July 2026 by SyncBot (talk | contribs) (Sync: updated from Minecraft)

Template:Exclusive

A loot context is a set of parameters available to Minecraft:loot tables, Minecraft:predicates, Minecraft:item modifiers, and Minecraft:number providers. As different uses have different available parameters, a loot context is used to determine if a given loot table or predicate is valid to that use case, allowing this check to be done when the data pack is loaded, rather than at runtime.

Loot context types and uses

Used in loot tables

These loot context types are used in Minecraft:loot tables and can be set as the Template:Nbt of a loot table.

Loot context type When it is used Loot context parameters that are supplied Loot context parameters that may be supplied
Template:Cd
  • Used only by the hardcoded empty loot table. Supplies no loot context parameters.
  • Specifying Template:Cd means no context parameters can be used in this loot table.
None None
Template:Cd
  • Origin: The center of the chest.
Template:Cd
  • Origin: The position of the fishing bobber.
  • Tool: The fishing rod item that the player cast
Template:Cd
  • Loot from a living entity's death.
  • The command Template:Cmd.
  • Template:Cd entity: The entity that died.
  • Origin: The location of the entity's death.
  • Damage source: The source of the damage that caused the entity to die.
  • Template:Cd entity: The entity that was the source of the final damage to the victim entity.
  • Template:Cd entity: The entity that directly contacted the victim entity to kill them.
  • Template:Cd entity: The player that most recently damaged the victim entity.
Template:Cd
  • Origin: The position of the entity being spawned.
  • Template:Cd entity: The entity being spawned.
Template:Cd
  • Origin: The center of the suspicious block.
  • Template:Cd entity: The entity that used the brush on the suspicious block.
  • Tool: The tool used for brushing.
Template:Cd
  • Origin: The center of the vault.
  • Template:Cd entity: The entity that opened the vault. Not present for item display inside vaults.
  • Tool: The item used as a key.
Template:Cd
  • Gift from a cat, villager or sniffer.
  • Item laid by a chicken.
  • Origin: The cat, villager or sniffer's location.
  • Template:Cd entity: The cat, villager or sniffer that gave the gift. / The chicken that laid the item.
Template:Cd 
Template:Cd
  • Template:Cd entity: The player that gained the advancement.
  • Origin: The player's location when they gained the advancement.
Template:Cd
  • Not used. Supplies all loot context parameters.
  • Specifying Template:Cd or omitting it means no checking for context parameters in this loot table when loading the data pack.
N/A N/A
Template:Cd
  • Loot from mining a block.
  • Loot from a block being exploded.
  • The command Template:Cmd.
  • Block state: The block that was broken.
  • Origin: The center of the broken block.
  • Tool: The tool used to mine the block.
  • Template:Cd entity: The player that mined the block, or the entity that caused the explosion.
  • Block entity: Any block entity data of the block that was broken, if it was a block entity.
  • Explosion radius: The radius of the explosion that broke the block, if broken via an explosion.
Template:Cd
  • Origin: The position of the entity being sheared.
  • Template:Cd entity: The entity being sheared.
  • Tool: The tool used for the interaction.
Template:Cd
  • Template:Cd: The entity being interacted with.
  • Tool: The tool used for the interaction.
Template:Cd
  • Block state: The block that was interacted with.
  • Block entity: Any block entity data of the block that was interacted with, if it is a block entity.
  • Template:Cd: The player or entity that interacted.
  • Tool: The tool used for the interaction.

Only used in predicates

These loot contexts cannot be set at type of a loot table. Instead, they are used for other invocation of Minecraft:predicates, Minecraft:item modifiers, Minecraft:slot sourcesTemplate:Upcoming, and Minecraft:number providersTemplate:Upcoming.

Loot context type When it is used Loot context parameters that are supplied Loot context parameters that may be supplied
Template:Cd
  • Origin: The position where the command is run.
Template:CdTemplate:Upcoming
  • Origin: The position where the command is run.
  • Container: The container or inventory being evaluated.
Template:Cd
  • Origin: The position of the entity being checked.
  • Template:Cd entity: The entity being checked.
Template:Cd
  • Used internally when an advancement invokes a predicate on an entity.
  • Template:Cd entity: The entity being checked.
  • Origin: The position of the player who triggers this advancement criterion.
Template:Cd
  • Used internally when an advancement invokes a predicate on the location of a block where an item was used on.
  • Template:Cd entity: The player to gain the advancement.
  • Origin: The center of the block that was interacted with.
  • Tool: The item used to interact with the block.
  • Block state: The block that was interacted with.
  • Block entity: Template:Upcoming Any block entity data of the block at the location, if it was a block entity.
Template:Cd
  • Used internally when an advancement invokes a predicate on Template:Cd trigger.
  • Template:Cd entity: The player to gain the advancement.
  • Origin: The center of the block that was interacted with.
  • Block state: The block that was interacted with.
Template:CdTemplate:Upcoming
  • Origin: The center of the workstation block.
  • Block state: The state of the workstation block.
  • Block entity: The block entity data of the workstation block.
  • Container: The inventory of the workstation block.
Template:Cd
  • Template:Cd entity: The attacked entity.
  • Enchantment level: The level of the enchantment currently evaluated
  • Origin: Position of the event Template:More info
  • Damage source: The damage source of the attack that caused the enchantment to trigger
Template:Cd
  • Tool: The item enchanted with the evaluated enchantment.
  • Enchantment level: The level of the enchantment currently evaluated
Template:Cd
  • Template:Cd entity: The attacked entity.
  • Enchantment level: The level of the enchantment currently evaluated
  • Origin: Position of the event Template:More info
  • Enchantment active status: Whether the enchantment was already active before the current evaluation
Template:Cd
  • Template:Cd entity: The attacked entity.
  • Enchantment level: The level of the enchantment currently evaluated
  • Origin: Position of the event Template:More info
Template:Cd
  • Template:Cd entity: The entity that hit the block.
  • Enchantment level: The level of the enchantment currently evaluated
  • Origin: Center of the block that was hit
  • Block state: The block that was hit
Template:Cd Used for evaluating villager trades.
  • Origin: The position of the villager or wandering trader
  • Template:Cd entity: The villager or wandering trader.

Navigation

Template:Navbox Java Edition technical

Minecraft:de:Beutekontext Minecraft:fr:Contexte de butin Minecraft:ja:ルート文脈 Minecraft:pt:Contexto de saque Minecraft:zh:战利品上下文