Actions may have requirements they have to pass before executing the action itself.
If an action does not pass its requirements it does not have a result, which makes it different from failing the action, despite not doing anything either.
Sometimes this difference is used, for example in the minecraft:first_to_pass_requirements sequence handler and in Dispense Behaviors.
In other cases this is treated as if the action failed.
The conditions use the following loot context parameters with the minecraft:action loot context type:
this_entity | The entity specified in context . Is optional. |
origin | The position specified in context . |
tool | The item stack from the context. Is optional. |
side | The side from the context. Is optional. |
{
"context": {
"entity": "this",
"position": "target"
},
"conditions": {
"condition": "minecraft:location_check",
"predicate": {
"block": {
"blocks": "minecraft:rooted_dirt"
}
}
}
}