Loot Conditions
Loot conditions can be used to check whether a loot entry or loot pool should be used in the current context. In both cases, a list of conditions is defined; the entry or pool is only used if all conditions pass. During datagen, they are added to a LootPoolEntryContainer.Builder<?>
or LootPool.Builder
by calling #when
with an instance of the desired condition. This article will outline the available loot conditions. To create your own loot conditions, see Custom Loot Conditions.
minecraft:inverted
This condition accepts another condition and inverts its result. Requires whatever loot parameters the other condition requires.
{
"condition": "minecraft:inverted",
"term": {
// Some other loot condition.
}
}
During datagen, call InvertedLootItemCondition#invert
with the condition to invert to construct a builder for this condition.
minecraft:all_of
This condition accepts any number of other conditions and returns true if all sub conditions return true. If the list is empty, it returns false. Requires whatever loot parameters the other conditions require.
{
"condition": "minecraft:all_of",
"terms": [
{
// A loot condition.
},
{
// Another loot condition.
},
{
// Yet another loot condition.
}
]
}
During datagen, call AllOfCondition#allOf
with the desired condition(s) to construct a builder for this condition.