Skip to content

Rules: and / or

The default rules { ... } block already ANDs everything inside. The explicit and wrapper is mostly useful inside or (since you can’t otherwise nest AND inside OR). The or wrapper passes when any of its child rules pass.

rules {
or {
permission: "vip"
money: 1000
}
}

This passes if the player has the VIP permission OR has $1000+. Either condition is enough.

rules {
or: [
{
and {
permission: "vip"
money: 100
}
}
{
and {
permission: "admin"
gamemode: CREATIVE
}
}
]
}

Nested form: passes if (VIP and $100+) OR (admin and creative mode). Each entry in the or: list is a separate rule group.

There’s also oneof (matches first true entry, short-circuits) - see the Item Enhancer example for that.