Conditions
EasyMenu 7 features a unified condition syntax used identically across open-when, visible-when, enabled-when, and variant when clauses.
Condition Types
Shorthand Forms
Besides a section, a condition accepts these short forms:
| Form | Meaning |
|---|---|
visible-when: "myserver.vip" | A bare string is a permission check (permission). A blank string is an error. |
visible-when: true / false | Always passes / always fails. Handy for hiding an item temporarily. |
| Omitted (or an empty section) | Always passes. |
When one section lists several keys, all of them must hold (an implicit all).
visible-when:
permission: "myserver.vip" # shown only when both of these hold
world: "world"
An unknown key is an error (invalid-condition) and the reload is rejected.
1. Permissions
Check if the player possesses a permission node:
visible-when:
permission: "myserver.vip"
2. World Restrictions
Check the player's current world. World names are matched case-insensitively:
# 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). Matching is case-insensitive. Give a list to pass when any one of the modes matches:
visible-when:
gamemode: "SURVIVAL"
# Several modes (any of them)
enabled-when:
gamemode:
- SURVIVAL
- ADVENTURE
4. PlaceholderAPI Comparisons
Compare values resolved via PlaceholderAPI against expectations. value, operator and compare are all required:
enabled-when:
placeholder:
value: "%vault_eco_balance%"
operator: ">="
compare: "1000"
Both value and compare are expanded when the menu is shown or clicked, so a placeholder may be written on either side.
Comparison Operators (operator)
The following operators are supported in placeholder condition blocks:
| Operator | Type | Meaning | Evaluation Example |
|---|---|---|---|
== | Text (exact match) | Equals | value: "%player_gamemode%", compare: "survival" |
!= | Text (exact match) | 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" |
Operator Aliases
These aliases are also accepted, case-insensitively:
| Operator | Aliases |
|---|---|
== | =, eq, equals |
!= | <>, ne, not-equals |
> | gt |
>= | ge, gte |
< | lt |
<= | le, lte |
Numeric operators (>, >=, <, <=) use arbitrary-precision numbers (BigDecimal). Thousands separators (1,000) are stripped before parsing. If either side fails to parse as a number, the condition safely evaluates to false without throwing an error.
Text comparisons such as == and != are case-sensitive.
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"
all and any take a list of conditions. A non-list value is an error, and an empty list always passes.