Requirements
Everything about DeluxeMenus requirements!
IMPORTANT!
Click requirements do not work without their click commands counterparts! Having success_commands set up will not be enough!
Syntax
Requirements allow you to restrict certain actions or even an entire menu and only allow certain players to see and/or use the menu.
Requirements
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.
Deny Commands
Deny commands are used to execute actions when players don't meet requirements. These actions can be set per requirement or per requirement list.
Success Commands
Similar to deny commands, Success commands are used to execute actions when players meet requirements. These actions can be set per requirement or per requirement list.
For click requirements, having success_commands is not enough! Click commands are also needed.
Minimum Requirements
If this option is used, not all requirements that have optional: true
will be checked. Instead, it will stop when enough requirements are met.
This option only works for requirements that have optional: true
. All the other requirements will still be checked
Stop At Success
When mimimum requirements is used, the requirement validation will not stop when enough requirements are met. Instead it will continue with all requirements check. If this option is enabled, when the number of minimum requirements is met, validation for all remaining requirements will stop.
Requirement types
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"
Has permission
Checks if the player has the specified permission (Vault is required).
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"
).
Has permissions
Checks if the player has all the specified permissions (Vault is required). If minimum: #
is specified, it checks if the player has at least # permissions from the list.
To invert the requirement (Check if the player doesn't have the permissions) you can simply add the exclamation mark before the type name (like this type: "!has permissions"
).
Has money
Checks if the player has the specified amount of money (Vault is required).
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"
).
Has Item
Required 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"
).
Has support for custom materials. Please see here for a list of supported custom materials.
Has Meta
Meta uses Persistent Data Containers which means this feature will only work on servers that are 1.14 or newer!
Required 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"
).
Has Exp
Required 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 default
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 exp"
).
Is Near
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"
).
JavaScript
Example:
Evaluates a JavaScript expression that must return true or false.
String Equals
Example:
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"
).
String Equals Ignore Case
Example:
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"
).
String Contains
Example:
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"
).
String Length
Example:
Checks if input:
is longer than or equal to min:
and shorter than or equal to max:
.
This requirement does not have a negative counterpart: !string length
Is Object
Example:
Checks if input:
can be mapped to the Java Object you specified.
INT - checks if the input can be mapped to an integer
DOUBLE - checks if the input can be mapped to a double-precision floating point number
UUID - checks if the input can be mapped to a UUID
PLAYER - checks if the input matches a player's name or a player's uuid
This requirement does not have a negative counterpart: !string length
Regex matches
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"
).
Comparators
Compares input:
with output:
.
Now both the input and the output support floating point values.
Available options
==
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:
Examples
Open Requirement
View Requirement
Left/Right Click Requirement
Minimum Requirements
Last updated
Was this helpful?