All Of (Meta Condition Type)
Passes when every condition in the list passes, and an empty list passes. It works in every kind of condition, and the conditions inside must be the same kind as the one containing them.
Type ID: apoli:all_of (alias apoli:and)
Fields
| Field | Type | Default | Description |
|---|---|---|---|
conditions | array of conditions | required | All of them must pass. They are the same kind as the containing condition. |
Examples
Sneaking and in water:
{
"type": "apoli:all_of",
"conditions": [
{ "type": "apoli:sneaking" },
{ "type": "apoli:submerged_in", "fluid": "minecraft:water" }
]
}Nested with apoli:any_of to build "A and (B or C)":
{
"type": "apoli:all_of",
"conditions": [
{ "type": "apoli:daytime" },
{
"type": "apoli:any_of",
"conditions": [
{ "type": "apoli:in_rain" },
{ "type": "apoli:submerged_in", "fluid": "minecraft:water" }
]
}
]
}Every condition also takes inverted, so "A and not B" needs no extra nesting:
{
"type": "apoli:all_of",
"conditions": [
{ "type": "apoli:on_fire" },
{ "type": "apoli:submerged_in", "fluid": "minecraft:water", "inverted": true }
]
}tip
Conditions are checked in order and stop at the first failure, so put the cheap ones first, such as a resource check before an apoli:command.