Built in predicates
July 29, 2023 ยท View on GitHub
Examples will be shown in JSON format (with comments using //, but you shouldn't copy them). If mod that uses it uses different/incompatible format,
check its page for information on how to remap it.
Types:
All true predicate
{
"type": "all",
"values": [
/* List of predicates */
]
}
Returns true if all contained predicates have success value of true.
Any true predicate
{
"type": "any",
"values": [
/* List of predicates */
]
}
Returns true if at least one contained predicates have success value of true.
Comparison predicate
{
"type": "equal", // "less_than", "less_or_equal", "more_than" or "more_or_equal"
// A string (text in quotes), a number or predicate definition
"value_1": "",
// Same as "value_1"
"value_2": ""
}
Checks if value_1 (static or result of predicate) is equal to/less_than/more_than value_2. Depends on type.
Negate predicate
{
"type": "negate",
// Predicate definition
"value": {
"type": "..."
}
}
Negates success value of provided predicate.
Operator predicate
{
"type": "operator",
// Operator level of player
"operator": 4
}
Checks if player has required operator level.
Statistic predicate
{
"type": "statistic",
// (Optional) Statistic type to check agains (defaults to "minecraft:custom")
"stat_type": "minecraft:custom",
// Key of the statistic, an identifier
"key": ""
}
Checks and returns value of player's statistic with success value of true if it's higher than 0. Should be used with other predicates.
See https://minecraft.fandom.com/wiki/Statistics#Statistic_types_and_names
Entity predicate
{
"type": "entity",
// Vanilla predicate definition
"value": {
/* More json here */
}
}
Checks using Vanilla (advancement) predicates.
See https://minecraft.fandom.com/wiki/Template:Nbt_inherit/conditions/entity
Permission predicate (requires Lucko/Fabric Permission API)
{
"type": "permission",
// Permission key required by player
"permission": "...",
// (Optional) Alternative operator level (number)
"operator": 4
}
Checks if player has specified permission.
Permission Option predicate (requires Lucko/Fabric Permission API)
{
"type": "permission_option",
// Option key
"option": "..."
}
Checks if player has specified option set by permission mod. Should be used with others for more specific checks (see Comparator predicates).
Placeholder predicate (requires Text Placeholder API)
{
"type": "placeholder",
// Placeholder value with arguments, without `%`, for example "player:displayname"
"placeholder": "...",
// (Optional) Boolean, making it return raw value (if provides string, it won't be formatted). Defaults to false
"raw": false
}
Returns value of provided placeholder, to be used with other comparators.
Has (Entity/Player/World/Game Profile) (0.2.0+1.20.1 and newer)
{
// [X] needs to be replaced with entity, player, world, game_profile
"type": "has_[X]"
}
Checks if Entity/Player/World/Game Profile is present.
Starts With (0.2.0+1.20.1 and newer)
{
"type": "starts_with",
// A string (text in quotes), a number or predicate definition
"input": "",
"argument": "",
}
Checks if input starts with argument (converted to strings)
Ends With (0.2.0+1.20.1 and newer)
{
"type": "ends_with",
// A string (text in quotes), a number or predicate definition
"input": "",
"argument": "",
}
Checks if input starts with argument (converted to strings)