Passes when every condition passes. Usually written with &&.
AllOf(terms) termsPredicateListRefPasses when all of these conditions pass.
Helpers that build a minecraft:loot_condition object, one for each of its types. Where a field takes one, write the helper's call; its
name is the type it makes. Click a type to see what it accepts.
Passes when every condition passes. Usually written with &&.
AllOf(terms) termsPredicateListRef Passes when all of these conditions pass.
Passes when any condition passes. Usually written with ||.
AnyOf(terms) termsPredicateListRef Passes when any of these conditions pass.
Passes when the damage that killed the entity matches a damage source predicate.
DamageSourceProperties(predicate) predicateDamageSourcePredicate Inside an enchantment's effects, passes when the enchantment is active (true) or inactive (false).
EnchantmentActiveCheck(active) activebool Passes when an entity matches an entity predicate.
EntityProperties(entity, predicate) entityEntityTarget Which entity to check: this (the entity that died, or the player that opened or broke something), attacker, direct_attacker or attacking_player.
predicateEntityPredicate What the entity must be.
Passes when an entity's scoreboard scores are in the given ranges.
EntityScores(entity, scores) entityEntityTarget Which entity to check: this (the entity that died, or the player that opened or broke something), attacker, direct_attacker or attacking_player.
scoresmap of string to IntRange A map from objective name to a range of scores.
EnvironmentAttributeCheck(attribute, value) attributeenvironment_attribute id valueany (depends on attribute) Passes when a number is in a range.
FloatValueCheck(value, test) valueFloatNumberProviderRef testFloatRange Passes when value is within the test range.
Passes when a whole number is in a range.
IntValueCheck(value, test) valueIntNumberProviderRef testIntRange Passes when value is within the test range.
Passes when term fails. Usually written with !.
Inverted(term) termPredicateRef The condition to invert.
Passes when a player killed the entity.
KilledByPlayer(inverse?) inverseoptionalbool true to pass when no player killed it instead.
Passes when the position, shifted by the offsets, matches a location predicate: biome, structure, light, block and more.
- offsetX: Blocks added to x before checking. - offsetY: Blocks added to y before checking. - offsetZ: Blocks added to z before checking.
LocationCheck(predicate, offsetX?, offsetY?, offsetZ?) predicateLocationPredicate What the location must be.
offsetXoptionalint offsetYoptionalint offsetZoptionalint Passes when the block, such as the one being broken, matches.
MatchBlock(blocks?, state?, nbt?, components?, predicates?) blocksoptionalblock id | #block tag | list of block ids The blocks or block tag that pass.
stateoptionalBlockPredicateState Block states the block must have, such as age = "7".
nbtoptionalstring | any (depends on blocks) componentsoptionalDataComponentExactPredicate Match exact data component values on the block entity.
predicatesoptionalDataComponentPredicate Test data component values on the block entity.
Passes when the tool used, such as the pickaxe that broke a block, matches an item predicate.
MatchTool(predicate) predicateItemPredicate What the tool must be.
Passes at random, with probability chance.
RandomChance(chance) chanceFloatNumberProviderRef Accepts a value between 0 & 1 (inclusive).
Predicate coin_flip = RandomChance(0.5)Passes at random, with a higher chance when the attacker's weapon has an enchantment, as looting does for rare drops.
RandomChanceWithEnchantedBonus(unenchanted_chance, enchanted_chance, enchantment) unenchanted_chancenumber 0..1 The chance without the enchantment, from 0 to 1.
enchanted_chanceLevelBasedValue The chance by enchantment level.
enchantmentenchantment id The enchantment that raises the chance.
Passes with a chance of 1 divided by the explosion's radius, and always when there was no explosion. Vanilla block drops use it so explosions destroy some items.
SurvivesExplosion() Passes at random, with the chance picked by the level of an enchantment on the tool. Vanilla uses it for saplings and flint.
TableBonus(enchantment, chances) enchantmentenchantment id The enchantment whose level picks the chance.
chanceslist of number 0..1 Probabilities for each enchantment level
Passes when a world clock's time is in a range.
TimeCheck(clock, value, period?) clockworld_clock id The world clock to check.
valueIntRange Check the current game tick.
periodoptionalint Game tick supplied to value check gets modulo-divided by this.
For example, if set to 24000, value operates on a time period of days.
Predicate night = TimeCheck(clock = overworld, value = 13000..23000, period = 24000)Passes when the weather matches. Leave out what doesn't matter.
WeatherCheck(raining?, thundering?) rainingoptionalbool true to require rain, false to require no rain.
thunderingoptionalbool true to require a thunderstorm, false to require none.
Predicate storm = WeatherCheck(thundering = true)