Requirements

Everything about DeluxeMenus requirements!

Syntax

# 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: true
  requirements:
    # 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 requirements
      optional: true
  # This can only be defined for open and
  # left/right click requirement
  deny_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.

Requirements

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.

  • Placeholders and arguments can be used in the requirements.

  • If you set multiple requirements, all of them should be met (Use JavaScript type or minimum_requirements to add optional requirements).

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.

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.

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

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").

To use a placeholder as a value for the amount, replace the amount: field with placeholder:.

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 Meta

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:.

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

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:.

Available options

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:

Examples

Open Requirement

View Requirement

Left/Right Click Requirement

Minimum Requirements

Last updated

Was this helpful?