---
description: All requirements and examples of use
---

# 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"

```
