Conditions
Panels, components, buttons, and other panel elements can use conditions to control when they are visible or accessible. Conditions are powerful logic statements built using custom syntax that checks things like player names, permissions, values, and more.
These expressions allow you to dynamically control panel behavior based on server state or player data. Placeholders in PlaceholderAPI will be parsed in these conditions to get values from other plugins and data.
How Conditions Work
Anywhere a conditions:
field is used (such as on a panel or a component), you can define a logical expression that determines whether that item should be available.
If the condition evaluates to true, the item will be shown or accessible. If it evaluates to false, it will be hidden or skipped.
Conditions are parsed left to right, and support:
- Logical operators:
$AND
,$OR
,$NOT
- Comparison operators:
$EQUALS
,$ATLEAST
,$HASPERM
- Grouping with brackets (single-depth only)
Spacing and format are strict. Conditions must follow the exact pattern shown in the examples below.
Basic Examples
Check if the player name is "RockyHawk" and they have the gamemode.creative
permission:
conditions: "%player_name% $EQUALS RockyHawk $AND %player_name% $HASPERM gamemode.creative"
Same as above, but now they must not have the permission to pass the conditions:
conditions: "%player_name% $EQUALS RockyHawk $AND $NOT %player_name% $HASPERM gamemode.creative"
Using brackets to group checks: the player name must not be "RockyHawk" and they must not have the permission:
conditions: "$NOT (%player_name% $EQUALS RockyHawk $AND %player_name% $HASPERM gamemode.creative)"
A more advanced condition using multiple expressions:
conditions: "$NOT (%player_name% $EQUALS RockyHawk $AND 400 $ATLEAST 500) $AND ($NOT %player_name% $EQUALS Steve $OR %player_name% $HASPERM gamemode.creative)"
Working Example
The example shows below how conditions can be used to incorporate logic into the items in your panels. In the example below, an item will be displayed that allows the player to upgrade from rank two to rank three for a payment. The four items will dynamically be displayed in the slot depending on if the player already has rank 3, has rank 2 first, and if they have enough money or not.
layout:
'4':
- already_rank_three
- no_rank_before_three
- buy_rank_three
- not_enough_rank_three
items:
already_rank_three:
material: 'LIGHT_BLUE_WOOL'
name: '<aqua><bold>Rank 3'
conditions: '%player_name% $HASPERM rank.level.3'
lore:
- '<dark_aqua>[!] You already have this rank.'
no_rank_before_three:
material: 'RED_WOOL'
conditions: '$NOT %player_name% $HASPERM rank.level.2'
name: '<red><bold>Rank 3'
lore:
- "<dark_red>[!] You need the previous rank first."
buy_rank_three:
material: 'LIME_WOOL'
name: '<green><bold>Rank 3'
lore:
- '<dark_green>[!] Purchase for $5000'
conditions: '%vault_eco_balance% $ATLEAST 5000'
actions:
requirements:
- '[vault] 5000'
commands:
- '[sound] ENTITY.PLAYER.LEVELUP'
- '[msg] <reset>'
- '[msg] <reset> <gold><bold>CONGRATS <white>%player_name%<gold>!'
- '[msg] <white> You have purchased <aqua>Rank 3'
- '[msg] <reset>'
- '[console] lp user %player_name% permission set rank.level.3 true'
- '[refresh] 3'
not_enough_rank_three:
material: 'RED_WOOL'
name: '<red><bold>Rank 3'
lore:
- "<dark_red>[!] You need $5000 for this rank."
Available Operators
NOT
Usage: $NOT
Negates the condition that follows it. Can also wrap grouped conditions in brackets.
AND
Usage: $AND
Requires both the left and right conditions to be true.
OR
Usage: $OR
Requires at least one of the left or right conditions to be true.
Available Comparisons
EQUALS
Usage: $EQUALS
Compares two values. Case-insensitive.
conditions: '%player_name% $EQUALS RockyHawk'
ATLEAST
Usage: $ATLEAST
Compares two numbers. True if the first number is greater than or equal to the second.
conditions: '%player_health% $ATLEAST 10'
HASPERM
Usage: $HASPERM
Checks if the specified player has a permission.
conditions: '%player_name% $HASPERM commandpanels.open'
- Conditions only support one level of brackets. Nested brackets will not work.
- Placeholders must be used where player data or context is needed (e.g.,
%player_name%
,%player_health%
). - Incorrect syntax or invalid conditions will result in the condition being skipped or always false.
Where to Use Conditions
Conditions can be used in many parts of your panels, including:
- Panel-level: to control access to the entire panel.
- Component-level: to show/hide individual buttons or fields.
- Dialog elements: to conditionally show inputs or text blocks.
- Floodgate or inventory buttons: for dynamic visibility based on user state.