Minecraft:Loot context: Difference between revisions
More actions
Sync: updated from Minecraft |
Sync: updated from Minecraft |
||
| Line 147: | Line 147: | ||
|- | |- | ||
| {{cd|command}} || | | {{cd|command}} || | ||
* Used internally by commands such as {{cmd|item modify}} or {{cmd|execute (if{{!}}unless) predicate}}. | * Used internally to evaluate [[Minecraft:predicate]]s and [[Minecraft:item modifier]]s by commands such as {{cmd|item modify}} or {{cmd|execute (if{{!}}unless) predicate}}. | ||
| | | | ||
* '''Origin:''' The position where the command is run. | * '''Origin:''' The position where the command is run. | ||
Revision as of 11:50, 20 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:战利品上下文