# Requirements

<mark style="color:purple;">**open\_requirements:**</mark>\
These requirements are used to determine whether a player can or cannot open a menu."

```yaml
open_requirements:
  type: "has_permission"
  permission: "mapmenu.custom_menu"
  deny_actions:
    - "[message] &cYou do not have permission to do this action"
```

<mark style="color:purple;">**requirements:**</mark>\
layer requirements. These requirements are used to determine whether a player can select a button or not."

```yaml
  day:
    type: "button"
    texture_outline: "examples/button_outline.png"
    position: "[5, 64]"
    actions:
      requirements:
        type: "has_permission"
        permission: "essentials.time.set"
        deny_actions:
          - "[message] &cYou do not have permission to do this action"
      actions:
        - "[console] day"
```

<mark style="color:purple;">**view\_requirements:**</mark>\
view\_requirements is used so that a player, if they do not meet these requirements, cannot see the layer

```yaml
day:
    type: "button"
    texture_outline: "examples/button_outline.png"
    position: "[5, 64]"
    actions:
      view_requirements:
        type: "has_permission"
        permission: "essentials.time.set"
      actions:
        - "[console] day"
```

<mark style="color:yellow;">**Available types for requirements**</mark>

```yaml
#has_permission
type: "has_permission"
permission: "essentials.time.set"

#does_not_have_permission
type: "does_not_have_permission"
permission: "testpermission.user"

#compare
#comparators: "==, >, >=, <, <=, !=" 
#You can also use "==" or "&&"
type: "compare"
value: "%player_name% == FavioMC19"

#javascript
#You can refer to
# the player as 'BukkitPlayer'
# the server as 'BukkitServer'
# and the plugin as 'MapMenuPlugin'
#In this example, the actions would only be called if the player is not hungry
type: "javascript"
expression: "BukkitPlayer.getFoodLevel() == 20"

```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://nekoplugins.gitbook.io/mapmenu/requirements.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
