Minecraft:Loot context: Difference between revisions
More actions
Sync: updated from Minecraft |
Sync: updated from Minecraft |
||
| Line 132: | Line 132: | ||
| | | | ||
* '''Block state:''' The block that was interacted with. | * '''Block state:''' The block that was interacted with. | ||
* '''Origin:''' The center of the block that was interacted with.{{upcoming|java 26.3}} | |||
| | | | ||
* '''Block entity:''' Any block entity data of the block that was interacted with, if it is a block entity. | * '''Block entity:''' Any block entity data of the block that was interacted with, if it is a block entity. | ||
Latest revision as of 11:14, 29 July 2026
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 |
|
None | None |
| Template:Cd |
|
|
|
| Template:Cd |
|
|
|
| Template:Cd |
|
|
|
| Template:Cd |
|
|
|
| Template:Cd |
|
|
|
| Template:Cd |
|
|
|
| Template:Cd |
|
|
|
| Template:Cd |
|
|
|
| Template:Cd |
|
|
|
| Template:Cd |
|
N/A | N/A |
| Template:Cd |
|
|
|
| Template:Cd |
|
|
|
| Template:Cd |
|
|
|
| Template:Cd |
|
|
|
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 |
|
|
|
| Template:CdTemplate:Upcoming |
|
|
|
| Template:Cd |
|
|
|
| Template:Cd |
|
|
|
| Template:Cd |
|
|
|
| Template:Cd |
|
|
|
| Template:CdTemplate:Upcoming |
|
|
|
| Template:Cd |
|
|
|
| Template:Cd |
|
||
| Template:Cd |
|
||
| Template:Cd |
|
||
| Template:Cd |
|
||
| Template:Cd | Used for evaluating villager trades. |
|
|
Template:Navbox Java Edition technical
Minecraft:de:Beutekontext Minecraft:fr:Contexte de butin Minecraft:ja:ルート文脈 Minecraft:pt:Contexto de saque Minecraft:zh:战利品上下文