🇱🇷
zMenu
Marketplace
English
English
  • 🍾Getting started
  • 🔌Installing zMenu
  • ➕Supported Plugins
  • 👍zMenu+
  • â›°ī¸Configurations
    • â„šī¸Informations
    • 📜Commands and Permissions
    • đŸĒ§PlaceHolder
    • How to create an inventory step by step
    • 👨‍đŸ’ģInventories
    • âšī¸Buttons
    • 🏁Requirements
    • â˜ĸī¸Actions
    • đŸĒItems
    • Global Placeholders
    • 🔋Patterns
    • Commands
    • 🛝Player data
    • đŸĻŦConfig.json
  • API
    • â„šī¸Informations
    • Create Button
    • Create Material Loader
    • Create ButtonOption
    • Load Inventory
    • Fast Events
  • đŸ—ƒī¸Plugin's files
  • 🕍Example GUI menus
Powered by GitBook
On this page
  • Requirements
  • Syntax
  • View Requirement
  • Open Requirement
  • Click Requirement
  • Requirements type
  • permission
  • placeholder
  • regex
  • item
  • job
  • luckperm
  • playername
  • money
  • and
  • or
Edit on GitHub
  1. Configurations

Requirements

The requirements feature allows you to perform actions based on a permission check.

Requirements

Syntax

# open-requirement
# click-requirement
view-requirement:

  # Set the minimum number of requirements to be able to say this is a success.
  # By default the value will be the same as the number of requirements.
  minimum-requirement: <number>
  
  # List of requirements, all information about each type below
  requirements:
    - type: permission
      permission: "example.permission"
      deny:
        - type: message
          messages:
            - "&cYou don't have permission !"
    - type: placeholder
      placeholder: "%player_gamemode%" # need PAPI ecloud Player
      value: "CREATIVE"    
      action: equals_string
      # Specific deny actions
      deny:
        - type: message
          messages:
            - "&cYou mus be in creative"      
    - type: regex
      input: "%player_item_in_hand%" # need PAPI ecloud Player
      regex: "(NETHERITE_|DIAMOND_|IRON_|GOLDEN_|STONE_|WOODEN_|LEATHER_|BOW|CROSSBOW|FISHING_ROD|SHEARS|SHIELD|TRIDENT|TURTLE_HELMET|ELYTRA|FLINT_AND_STEEL)"      
      deny:
        - type: message
          messages:
            - "&cYou dont have items in your hand !"
  
  # Global Success actions
  success:
    - type: sound
      sound: ENTITY_PLAYER_LEVELUP
      
  # Global Deny actions
  deny:    
    - type: message
      messages:
        - "&cYou doesn't have an item in your hand."

In addition to global deny and success actions, you can define specific deny and success actions for each requirement.

View Requirement

Defines the requirements a player must meet to see a button in the inventory.

Example:

view-requirement:
  deny:
    - type: chat
      messages:
        - "Hey, my name is %player%"
  success:
    - type: sound
      sound: ENTITY_PLAYER_LEVELUP
  requirements:
    - type: permission
      permission: "admin.use"
    - type: placeholder
      placeholder: "%player_is_flying%"
      value: "yes"
      action: equals_string

Open Requirement

Defines the requirements a player must meet to open the inventory.

Example

open-requirement:
  requirements:
    - type: regex
      input: "%player_item_in_hand%"
      regex: "(NETHERITE_|DIAMOND_|IRON_|GOLDEN_|STONE_|WOODEN_|LEATHER_|BOW|CROSSBOW|FISHING_ROD|SHEARS|SHIELD|TRIDENT|TURTLE_HELMET|ELYTRA|FLINT_AND_STEEL)"
  deny:
    - type: message
      messages:
        - "&cYou doesn't have an item in your hand."

In the example below, there is a check for the item in the player's hand. If the item matches the regex pattern, the player can open the inventory. Otherwise, they will receive a message, and the inventory will not open.

Click Requirement

Defines multiple requirements for clicking the button. You need to specify several requirements and the corresponding clicks.

You can apply all clicks directly by using the following format:

clicks:
  - ALL # or ANY

You can set the click type to ALL or ANY to apply the actions to all clicks. The list of clicks that will be included can be managed in the config.json file.

Example:

click-requirement:
  left-click: # You must put a name for your requirement, it will not be used.
    clicks:
      - LEFT
      - SHIFT_LEFT
    requirements:
      - type: placeholder
        placeholder: "%player_gamemode%"
        value: "CREATIVE"
        action: equals_string
    deny:
      - type: sound
        sound: VILLAGER_NO
        pitch: 0.5f
        volume: 1.5f
    success:
      - type: message
        messages:
          - "&aLeft click !"
  right-click: # You must put a name for your requirement, it will not be used.
    clicks:
      - RIGHT
      - SHIFT_RIGHT
    requirements:
      - type: placeholder
        placeholder: "%player_gamemode%"
        value: "CREATIVE"
        action: equals_string
    deny:
      - type: sound
        sound: VILLAGER_NO
        pitch: 1.5f
        volume: 0.5f
    success:
      - type: message
        messages:
          - "&aRight click !"

Requirements type

permission

- type: permission
  permission: <permission>

Checks if the player has the specified permission. To reverse the condition, add an exclamation mark ! in front of the permission, like this: !<permission>.


placeholder

- type: placeholder
  placeholder: <placeholder>
  value: <placeholder value>
  action: <placeholder action>
  target: <player / placeholder with player name>

You can specify a player; otherwise, the player who opens the inventory will be used by default.

Actions:

  • BOOLEAN (alias: b=): Checks if a value is true or false.

  • EQUALS_STRING (alias: s=): Checks if the text is strictly equal to the value.

  • EQUALSIGNORECASE_STRING (alias: s==): Checks if the text is equal to the value, ignoring case.

  • CONTAINS_STRING (alias: sc): Checks if the text is contained within the value.

  • DIFFERENT_STRING (alias: s!=): Checks if the text is different from the value.

  • SUPERIOR (alias: >): Checks if a number is strictly greater than the value.

  • LOWER (alias: <): Checks if a number is strictly less than the value.

  • SUPERIOR_OR_EQUAL (alias: >=): Checks if a number is greater than or equal to the value.

  • LOWER_OR_EQUAL (alias: <=): Checks if a number is less than or equal to the value.

  • EQUAL_TO (alias: ==): Verifies that two numbers are identical.


regex

- type: regex
  regex: <regex>
  input: <placeholder>

Checks if the input matches the specified regex pattern. The input can be a placeholder.


item

- type: item
  material: <material>
  amount: <amount of item>
  modelId: <model id> # default 0

Checks if the player has a specific item in their inventory.


job

- type: job
  job: <job name>

luckperm

- type: luckperm
  group: <group name>

playername

- type: playername
  player-name: <placeholder>

Allows to check if a placeholder returns a text that can be a player nickname.


money

- type: money
  amount: <amount>
  currency: <currency name>
  economy: <economy name> # Only the zEssentials, CoinsEngine and EcoBits plugins need this

and

Allows to combine multiple requirements into one.

- type: and
  requirements:
    - ... 
Example and + or requirement

This example uses an and and or requirement. The player must have the permission zmenu.test and zmenu.test2 and must have the permission zmenu.test3 or the permission zmenu.test4.

name: "&8Test And/Or"
size: 54
items:
  test:
    slot: 22
    view-requirement:
      requirements:
        - type: and
          requirements:
            - type: permission
              permission: zmenu.test
              success:
                - type: message
                  messages:
                    - "&7Test And 1 - &aOK"
              deny:
                - type: message
                  messages:
                    - "&7Test And 1 - &cKO"
            - type: permission
              permission: zmenu.test2
              success:
                - type: message
                  messages:
                    - "&7Test And 2 - &aOK"
              deny:
                - type: message
                  messages:
                    - "&7Test And 2 - &cKO"
        - type: or
          minimum: 1
          random: true
          requirements:
            - type: permission
              permission: zmenu.test3
              success:
                - type: message
                  messages:
                    - "&7Test And 3 - &aOK"
              deny:
                - type: message
                  messages:
                    - "&7Test And 3 - &cKO"
            - type: permission
              permission: zmenu.test4
              success:
                - type: message
                  messages:
                    - "&7Test And 4 - &aOK"
              deny:
                - type: message
                  messages:
                    - "&7Test And 4 - &cKO"
    item:
      material: PAPER
      name: "&aTest And/Or"
    else:
      item:
        material: PAPER
        name: "&cTest And/Or"

or

Allows to combine multiple requirements into one and have a minimum of required.

- type: or
  minimum: 1
  random: false
  requirements:
    - ...

The random option determines whether the list of requirements should be traversed randomly or not.

PreviousButtonsNextActions

Last updated 1 month ago

Allows you to define a permission using a placeholder. You must specify the placeholder, the action to be performed with the value, and the value that will be checked. For more information, .

Visit to create your regex pattern.

Allows to check if the player has the job. Works with plugin.

Allows to check if the player is in a group. Works with plugin.

Check if the player has enough money in their account. This only works with , , , , , , , , , and . CurrenciesAPI :

This feature is only available with !

This feature is only available with !

â›°ī¸
🏁
click here
regexr.com
JobReborn
LuckPerms
BeastTokens
Vault
PlayerPoints
ElementalTokens
ElementalGems
Level
Experience
zEssentials
EcoBits
CoinsEngine
VotingPlugin
https://github.com/Traqueur-dev/CurrenciesAPI
zMenu+
zMenu+