The requirements feature allows you to perform actions based on a permission check.
Requirements
Syntax
# open_requirement# click_requirementview_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.minimumRequirement:<number># List of requirements, all information about each type belowrequirements: - type:permissionpermission:"example.permission"deny: - type:messagemessages: - "&cYou don't have permission !" - type:placeholderplaceholder:"%player_gamemode%"# need PAPI ecloud Playervalue:"CREATIVE"action:equals_string# Specific deny actionsdeny: - type:messagemessages: - "&cYou mus be in creative" - type:regexinput:"%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:messagemessages: - "&cYou dont have items in your hand !"# Global Success actionssuccess: - type:soundsound:ENTITY_PLAYER_LEVELUP# Global Deny actionsdeny: - type:messagemessages: - "&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:chatmessages: - "Hey, my name is %player%"success: - type:soundsound:ENTITY_PLAYER_LEVELUPrequirements: - type:permissionpermission:"admin.use" - type:placeholderplaceholder:"%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:regexinput:"%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:messagemessages: - "&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_LEFTrequirements: - type:placeholderplaceholder:"%player_gamemode%"value:"CREATIVE"action:equals_stringdeny: - type:soundsound:VILLAGER_NOpitch:0.5fvolume:1.5fsuccess: - type:messagemessages: - "&aLeft click !"right_click:# You must put a name for your requirement, it will not be used.clicks: - RIGHT - SHIFT_RIGHTrequirements: - type:placeholderplaceholder:"%player_gamemode%"value:"CREATIVE"action:equals_stringdeny: - type:soundsound:VILLAGER_NOpitch:1.5fvolume:0.5fsuccess: - type:messagemessages: - "&aRight click !"
Checks if the player has the specified permission. To reverse the condition, add an exclamation mark ! in front of the permission, like this: !<permission>.
- type:placeholderplaceholder:<placeholder>value:<placeholder value>action:<placeholder action>target:<player / placeholder with player name>
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, click here.
You can specify a player; otherwise, the player who opens the inventory will be used by default.
- type:regexregex:<regex>input:<placeholder>
Checks if the input matches the specified regex pattern. The input can be a placeholder.