Click Requirements

In the previous section, two settings are defined without being explained.

  • requirement - used for a simple fast configuration

  • requirements-expression - used to combine multiple simple requirements

You CAN NOT have both of them at the same time. If both are present, only the simple requirement will be considered.

Simple Click Requirement

# click requirement config
menu-item:
  ...
  click-actions:
    ...
    requirement:
      req: '[permission] A.click'
      on-deny-actions:
        - '[message] &cYou do not have permission to click this.'
        - '[message] &cPermission needed: A.click'
#       - '[console_command] ban %player_name% how dare you click without permission'

Req

The req field is very similar to the click action syntax, [REQUIREMENT_NAME] <arguments>

Standard requirements:

  • [has_permission] <string> - checks if the player clicking has a specific permission

  • [has_money] <number> - checks if the player has a specific amount of money

On Deny Actions

Literally what the name says, when the req is denied, what actions should be executed for the player.

Requirements Expression

Allows you to use 'or'/'and' operators to combine multiple requirements.

Type

The type field is mandatory for the requirements-expression, and it can only be OR/AND. This determines how the requirements should be handled.

For or, the player needs to have at least one of the requirements in the list.

For and the player needs to have all the requirements.

Requirements & More-Expressions

In the example above, the requirements-expression setting checks as follows:

Will allow clicking if the player has either A.click or B.click or (C.click and D.click at the same time) or (E.click and J.click at the same) permissions.

You do not need to have both requirements and more-expressions at the same time.

On Deny Actions

Although on-deny-actions can be defined for inner requirements too, only the top on-deny-actions will be executed if the expression fails.

Any on-deny-actions defined elsewhere than the place from the example will be ignored.

Last updated