Java only
Predicates are Java Edition datapack files. They are not supported in Bedrock. Use them with /execute if predicate mypack:my_predicate.
Namespace
Predicate name
ID
mypack:my_predicateFile
data/mypack/predicates/my_predicate.jsonCondition type
Chance50%
Predicate JSON
save to data/mypack/predicates/my_predicate.json{
"condition": "minecraft:random_chance",
"chance": 0.5
}Use in commands
/execute if predicate mypack:my_predicate run say Condition passed!The predicate JSON file must be in a loaded datapack at data/mypack/predicates/my_predicate.json before the command will work.