Requirement
The criteria to check before doing actions.
The criteria to check before doing actions.
What you see in the examples & set in your Menu is actually Requirement Set.
Make sure to check Requirement Set to understand how to correctly set requirements in your Menu (Particularly, how to set multiple requirements & set Actions when the requirements are met / failed to met).
permission-list:
slot: 1
type: predicate
CLICK-REQUIREMENT: # Click Requirement
default: # Click type
we-permission: # The name of the Requirement set
PERMISSION: # Here we are
- bettergui.test
- bettergui.test.1
fail-command: "tell: &cYou don''t have the correct permission!"
button:
COMMAND: "tell: &a[v] You have the correct permission!"
NAME: '&8Permission test'
LORE:
- 'To use this item, you need the'
- 'required permissions.'
- 'Otherwise, a configurable error'
- 'message will be displayed.'
ID: iron bars
success-action
(success-command
): the Action when the player passes all requirements.fail-action
(fail-command
): the Action when the player doesn’t pass any of the requirements.requirement-set-name: # The name of the Requirement Set
requirement-1: value-1 # The first requirement
requirement-2: value-2 # The second requirement
requirement-3: value-3 # The third requirement
<requirement..>: <value..> # More requirements
success-action: # The actions when the requirements are met
- action1
- action2
- action3
fail-action: # The actions when the requirements are not met
- action1
- action2
- action3
check-condition:
slot: 1
type: predicate
CLICK-REQUIREMENT: # Click Requirement
default: # Click type
we-permission: # The name of the Requirement Set
permission: # The permission requirement
- bettergui.test
- bettergui.test.1
level: 10 # The level requirement
fail-command: "tell: &cYou don''t meet the requirements!"
success-command: "tell: &a[v] You passed the requirements!"
button:
NAME: '&8Requirement Test'
LORE:
- 'To use this item, you need to pass all requirements.'
- 'Otherwise, a configurable error'
- 'message will be displayed.'
ID: iron bars
The requirement to check if the player is not in a cooldown timer (seconds). After checking successfully, the cooldown timer will start for the player.
cooldown: <seconds>
cooldown:
slot: 1
type: predicate
button:
COMMAND: "tell: &e You will need to wait 10 seconds to click again"
NAME: '&aCooldown'
LORE:
- 'This is a example of icon with cooldown'
ID: paper
click-requirement: # Click Requirement
default: # Click type
test-cooldown: # Requirement Set name
cooldown: 10 # Here we are
fail-command:
- "tell: &cWait until the cooldown is finished"
The requirement to check if the level of the player is higher or equal to the specific level
level: <level>
level:
value: <level>
take: <true/false>
take
value (true
or false
) to allow/disallow the plugin to take the level of the player alter checking successfullytest-view-requirement:
type: predicate
slot: 1
button:
id: exp_bottle
name: "&cA exp bottle"
lore:
- "You will see this icon when the level is higher than 5"
view-requirement: # View Requirement
level: # Requirement Set name
level: 5 # Here we are
test-click-requirement:
type: predicate
slot: 1
button:
id: exp_bottle
name: "&cA level checker"
command: "tell: &aYou reached level 5"
click-requirement: # Click Requirement
default: # Click type
test-level: # Requirement Set name
level: # Here we are
value: 5
take: true # Take the level
fail-command:
- "tell: &cTrain more"
The requirement to check if the player has the specific permission
permission: <permission>
permission:
- <permission>
- <permission>
- <permission>
...
-
before <permission>
to indicate that the plugin should check if the player doesn’t have the <permission>
permission:
slot: 1
type: predicate
CLICK-REQUIREMENT: # Click Requirement
default: # Click type
permission: # Requirement set name
PERMISSION: bettergui.test # Here we are
fail-command: "tell: &cYou don''t have the correct permission!"
button:
COMMAND: "tell: &a[v] You have the correct permission!"
NAME: '&8Permission test'
LORE:
- 'To use this item, you need the'
- 'permission "bettergui.test".'
- 'Otherwise, a configurable error'
- 'message will be displayed.'
ID: iron bars
permission-list:
slot: 2
type: predicate
CLICK-REQUIREMENT: # Click Requirement
default: # Click type
permission: # Requirement set name
PERMISSION: # Here we are
- bettergui.test
- bettergui.test.1
fail-command: "tell: &cYou don''t have the correct permission!"
button:
COMMAND: "tell: &a[v] You have the correct permission!"
NAME: '&8Permission test'
LORE:
- 'To use this item, you need the'
- 'required permissions.'
- 'Otherwise, a configurable error'
- 'message will be displayed.'
ID: iron bars
The requirement to check on conditions & expressions (Mainly Math extension)
If you want more advanced expressions, check out Eval Extra
condition: <condition>
<condition>
is true
, yes
, on
or 0
test-view-requirement:
type: predicate
slot: 1
button:
id: exp_bottle
name: "&cA exp bottle"
lore:
- "You will see this icon when the level is 0"
view-requirement: # View Requirement
level: # Requirement Set name
condition: "%math_{level} >= 0%" # Here we are
The requirement to check if the server is at a specific version or higher.
version: <value>
<value>
is the major part of the version of Minecraft.1.12.2
will be 12
1.18.2
will be 18
1.8.8
will be 8
test-xp:
slot: 0
id:
- EXPERIENCE_BOTTLE
- EXP_BOTTLE
name: "&eGive &f10 XP"
lore:
- ""
- "&fThis is a test template button"
- "&fLevel: {level}"
click-requirement:
old-version:
version: 13 # Check if the server is at 1.13.X
success-action: "console: xp add {player} 10 points"
fail-action: "console: xp 10 {player}"