Comment on page
Requirements
Everything about DeluxeMenus requirements!
IMPORTANT!
left/right/shift_left/shift_right/middle
click requirements won't work unless you also have their respective click commands. This is true even if you have set the success_commands
option# Other available requirement types:# open_requirement:# view_requirement:# left_click_requirement:# right_click_requirement:# shift_left_click_requirement:# shift_right_click_requirement:click_requirement:# Minimum requirements are optional.# If they are not set, then all# requirements will be needed for the# click commands to be executed.# In this example, only one of the# requirements will be needed.minimum_requirements: 1# This option is good for when you use minimum_requirements.# Instead of the plugin checking all the requirements,# it will stop when it has enough.stop_at_success: truerequirements:# You can define multiple requirements.# Each requiremnt should have a unique name.requirement_name:type: TYPE# These commands will be exeucted if# the requirement they're set for is# met even if the others are not.# You should be careful and not confuse# these with click_commands: !!!success_commands:- "[ACTIONTYPE] ACTION"- "[ACTIONTYPE] ACTION"# These commands will be executed if# the requirement they're set for is# not met even if the others are.deny_commands:- "[ACTIONTYPE] ACTION"- "[ACTIONTYPE] ACTION"# This option is only required if you# want ot use minimum_requirements:# Minimum requirements will only work# for the optional requirementsoptional: true# This can only be defined for open and# left/right click requirementdeny_commands:- "[ACTIONTYPE] ACTION"- "[ACTIONTYPE] ACTION"
Requirements allow you to restrict certain actions or even an entire menu and only allow certain players to see and/or use the menu.
Type | Description |
Defines the requirements to open the menu. | |
Defines the requirements to see an item in the menu. | |
Defines the requirements to (shift) left/right click an item. |
- If you set multiple requirements, all of them should be met (Use JavaScript type or minimum_requirements to add optional requirements).
When inverting requirements, make sure you put the type in quotation marks. This is because "!" is a special symbol in YAML so it will break the syntax.
ex:
type: "!has permission"
type: has permissionpermission: TEXT
Checks if the player has the specified permission.
To invert the requirement (Check if the player doesn't have the permission) you can simply add the exclamation mark before the type name (like this
type: "!has permission"
).type: has moneyamount: #
To invert the requirement (Check if the player doesn't have the amount of money) you can simply add the exclamation mark before the type name (like this
type: "!has money"
).To use a placeholder as a value for the amount, replace the
amount:
field with placeholder:
.type: has item# material option supports material names, placeholders and arguments.material: "TEXT"data: ## represents the CustomModelData the item should have.modeldata: #amount: #name: "TEXT"# lore can also be one single string: lore: "TEXT"lore:- "TEXT"# if this is enabled then the plugin will look for items that contain the value# set at the option "name" in their name and not for the exact valuename_contains: boolean# if this option is enabled then the plugin will check for the item name,# without caring about the case.name_ignorecase: boolean# if this is enabled then the plugin will look for items that contain the value# set at the option "lore" in their lore and not for the exact valuelore_contains: boolean# if this option is enabled then the plugin will check for the item lore,# without caring about the case.name_ignorecase: boolean# if this option is enabled, the plugin will consider only the items that# have no custom model data, no display name and no lore.strict: boolean# decides if the plugin should also check the armor slots of the player when# looking for itemsarmor: boolean# decides if the plugin should also check the off hand of the player when# looking for itemsoffhand: booleanRequired fields:
Material
Checks if the player has the specified item in the inventory.
To invert the requirement (Check if the player doesn't have the item) you can simply add the exclamation mark before the type name (like this
type: "!has item"
).Meta uses Persistent Data Containers which means this feature will only work on servers that are 1.14 or newer!
type: has metakey: "TEXT"meta_type: <STRING, BOOLEAN, DOUBLE, LONG, INTEGER>value: EXPECTED VALUERequired fields:
key meta_type value
Checks if the player has the specified meta.
If the
meta_type
is a number format (DOUBLE, LONG, INTEGER) it will check if the player's meta value is greater than or equal to the value
To invert the requirement (Check if the input doesn't match the output) you can simply add the exclamation mark before the type name (like this
type: "!has meta"
).type: has expamount: #level: boolean # true if you want to check for exp levels, false for exp pointsRequired fields:
amount
Checks if the player has the exp level or points.
If the
level
option does not exist, it will check for exp points by defaultTo invert the requirement (Check if the input doesn't match the output) you can simply add the exclamation mark before the type name (like this
type: "!has exp"
).type: is nearlocation: "WORLDNAME,X,Y,Z"distance: #Required fields:
location distance
Checks if the player is within
distance
of location
.To invert the requirement (Check if the input doesn't match the output) you can simply add the exclamation mark before the type name (like this
type: "!is near"
).type: javascriptexpression: 'EXPRESSION'Example:type: javascriptexpression: '%vault_eco_balance% >= 100'
Evaluates a JavaScript expression that must return true or false.
type: string equalsinput: "TEXT"output: "TEXT"Example:type: string equalsinput: "%server_name%"output: "HelpChat"
Checks if
input:
matches output:
(Case sensitive).To invert the requirement (Check if the input doesn't match the output) you can simply add the exclamation mark before the type name (like this
type: "!string equals"
).type: string equals ignorecaseinput: "TEXT"output: "TEXT"Example:type: string equals ignorecaseinput: "%server_name%"output: "helpchat"
Checks if
input:
matches output:
(Case insensitive).To invert the requirement (Check if the input doesn't match the output) you can simply add the exclamation mark before the type name (like this
type: "!string equals ignorecase"
).type: string containsinput: "TEXT"output: "TEXT"Example:type: string containsinput: "%server_name%"output: "chat"
Checks if
input:
contains output:
(Case sensitive).To invert the requirement (Check if the input doesn't contain the output) you can simply add the exclamation mark before the type name (like this
type: "!string contains"
).type: regex matchesinput: "TEXT"regex: "EXPRESSION"
Checks if
input:
contains the regular expression in regex:
.
Visit this site to create regular expressions easily.To invert the requirement (Check if the input doesn't contain the regular expression) you can simply add the exclamation mark before the type name (like this
type: "!regex matches"
).type: (==, >=, <=, !=, >, <)input: #output: #
Compares
input:
with output:
.Now both the input and the output support floating point values.
Comparator | Description |
== | input: equals to output: |
>= | input: greater than or equals to output: |
<= | input: less than or equals to output: |
!= | input: not equals to output: |
> | input: greater than output: |
< | input: less than output: |
open_requirement:
requirements:
example_1:
type: has permission
permission: open.menu.one
deny_commands:
- "[message] &cYou don't have the permission."
view_requirement:
requirements:
example_2:
type: string equals
input: "%player_is_op%"
output: "yes"
# left_click_requirement: or
right_click_requirement:
requirements:
example_3:
type: has money
amount: 100
deny_commands:
- "[message] &7You don't have enough money."
click_requirement:
minimum_requirements: 1
stop_at_success: true
deny_commands:
- "[message] &7You don't have 1 of the 2 permissions required."
requirements:
perm1:
type: has permission
permission: perm.1
perm2:
type: has permission
permission: perm.2
click_commands:
- "[message] &7You have 1 of the 2 permissions required."
Last modified 1yr ago