Conditions
EasyMenu 7 features a unified condition syntax used identically across open-when, visible-when, enabled-when, and variant when clauses.
Condition Types
1. Permissions
Check if the player possesses a permission node:
visible-when:
permission: "myserver.vip"
2. World Restrictions
Check the player's current world:
# Single world
visible-when:
world: "world_nether"
# List of allowed worlds
visible-when:
world:
- "world"
- "world_nether"
# in / not-in sections
visible-when:
world:
not-in:
- "world_the_end"
3. Gamemode Checks
Check player gamemode (SURVIVAL, CREATIVE, ADVENTURE, SPECTATOR):
visible-when:
gamemode: "SURVIVAL"
4. PlaceholderAPI Comparisons
Compare values resolved via PlaceholderAPI against expectations:
enabled-when:
placeholder:
value: "%vault_eco_balance%"
operator: ">="
compare: "1000"
Comparison Operators (operator)
The following operators are supported in placeholder condition blocks:
| Operator | Type | Meaning | Evaluation Example |
|---|---|---|---|
== | Text / Number | Equals | value: "%player_gamemode%", compare: "survival" |
!= | Text / Number | Not equals | value: "%server_online%", compare: "0" |
> | Number | Greater than | value: "%vault_eco_balance%", compare: "500" |
>= | Number | Greater than or equal | value: "%vault_eco_balance%", compare: "1000" |
< | Number | Less than | value: "%player_ping%", compare: "100" |
<= | Number | Less than or equal | value: "%player_level%", compare: "50" |
contains | Text | Substring match | value: "%luckperms_primary_group_name%", compare: "vip" |
not-contains | Text | Substring exclusion | value: "%luckperms_groups%", compare: "banned" |
starts-with | Text | Prefix match | value: "%player_name%", compare: "admin_" |
ends-with | Text | Suffix match | value: "%player_name%", compare: "_bot" |
:::note Numeric Safety
Numeric operators (>, >=, <, <=) use arbitrary-precision numbers (BigDecimal). If either side fails to parse as a number, the condition safely evaluates to false without throwing an error.
:::
Logical Combinations (AND / OR / NOT)
Combine multiple conditions:
All Must Hold (AND): all
visible-when:
all:
- permission: "myserver.donor"
- placeholder:
value: "%vault_eco_balance%"
operator: ">="
compare: "5000"
Any May Hold (OR): any
visible-when:
any:
- permission: "myserver.admin"
- permission: "myserver.moderator"
Inversion (NOT): not
visible-when:
not:
world: "world_the_end"