No conditions added yet. Select a condition type above and click "+ Add".
Predicates are JSON conditions used throughout Minecraft's data-driven systems: loot tables, advancements, and commands all rely on them. This visual builder lets you construct predicate JSON by selecting condition types, filling in parameters, and copying the output directly into your datapack files.
Writing Minecraft predicates by hand means wrestling with nested JSON and remembering exact field names. The builder above supports 9 condition types (entity properties, location checks, weather, random chance, killed by player, match tool, block state properties, damage source properties, and time checks) and generates valid JSON as you go.
Predicates power some of the most interesting datapack mechanics: conditional loot drops that depend on the tool used, advancements that trigger only in specific biomes, and command chains that run differently based on weather or time of day. If you build datapacks, predicates are something you will use constantly.
1. Add a condition. Pick from the 9 available types: entity properties, location check, weather check, random chance, killed by player, match tool, block state property, damage source properties, or time check, then click Add.
2. Configure parameters. Each condition type shows its relevant fields. Entity properties asks for entity type and optional NBT. Location check asks for biome, dimension, and coordinates. Random chance asks for a probability value.
3. Stack multiple conditions. Add as many conditions as needed. They combine with AND logic, meaning all conditions must be true for the predicate to pass.
4. Copy the JSON output. The generated JSON updates in real time. Copy it into your datapack's data/namespace/predicate/ directory or paste it directly into a loot table condition.
Each condition type checks a different aspect of the game state. Here is what they do and when to use them:
| Condition Type | What it checks |
|---|---|
| entity_properties | Type, location, effects, and NBT of an entity. The entity field can be this, attacker, direct_attacker, or attacking_player. |
| location_check | Biome, dimension, or the block at a position, with an optional X/Y/Z offset. Good for biome-gated drops or dimension-specific behavior. |
| random_chance | A probability between 0.0 and 1.0. For example, 0.25 means a 25% chance of passing. Common for rare loot drops. |
| match_tool | The tool used for the action: item ID, count range, or NBT. This is how block loot implements Silk Touch behavior. |
| block_state_property | A specific block state value, such as a crop at maximum growth or whether a door is open. Needs the block ID and property. |
The remaining types cover weather (raining or thundering), killed by player, damage source properties (explosion, fire, magic, projectile, bypasses armor), and time of day. For Looting-affected drops, use random_chance_with_enchanted_bonus in direct JSON editing.
Using predicates in commands. Place your predicate JSON at data/namespace/predicate/my_predicate.json and reference it with /execute if predicate namespace:my_predicate run say It matched!. This is the most flexible way to add conditional logic to command chains.
Predicates in loot tables. Loot table entries and pools can carry conditions arrays that use predicate conditions. Vanilla uses this heavily: diamond ore checks for Silk Touch vs Fortune, and mob drops check for killed_by_player. Multiple conditions all must pass (AND logic).
Combining with advancements. Advancement criteria can reference predicates for complex triggers. For example, fire an advancement when a player kills a zombie in a specific biome during a thunderstorm by combining entity_properties, location_check, and weather_check conditions.
A predicate is a JSON condition that evaluates to true or false. It is used by loot tables, advancements, and commands to check game state before performing an action. Think of it as an if statement for Minecraft's data-driven systems.
Use the command /execute if predicate namespace:predicate_name in chat. If the predicate evaluates to true the command succeeds (output 1), otherwise it fails (output 0). Chain it with run to execute commands conditionally.
Place them in data/namespace/predicate/ inside your datapack folder. The filename without .json becomes the predicate ID. For example, data/mypack/predicate/is_raining.json creates the predicate mypack:is_raining.
Not directly in a single list of conditions, which uses AND logic. To get OR logic use the alternative condition type, which passes if any of its sub-conditions are true. You can also use inverted to negate a condition.
The builder supports 9 condition types: entity_properties, location_check, weather_check, random_chance, killed_by_player, match_tool, block_state_property, damage_source_properties, and time_check. They cover entity data, position, biome, weather, probability, tools, block states, damage sources, and game time.
Browse more Minecraft tools: