# Custom menus requirements

> List of the available requirements:

Requirements are used in `view-requirements`, `open-requirements`, the different click requirements and in `conditional-lore` conditions. When you list more than one, every one of them has to be met.

## Negation

Put a `!` in front of any requirement to invert it. For example this item is only visible to players who **don't** have the permission:

```yaml
view-requirements:
  - "![permission] example.permission"
```

## Permission

Check if the player has the permission.

```yaml
[permission] example.permission
```

## Money

Check whether the player has enough money or not. The economy provider name and the currency can be omitted. To use a currency you must also specify the provider. See [Economy providers](../aurora/economy-providers.md) for the provider names and which ones support currencies.

```yaml
[money] 1000
[money] 1000 Vault
[money] 1000 CoinsEngine gems
```

## Exp level

Check if the player has the required vanilla exp level.

```yaml
[exp-level] 10
```

## Items

Check if the player has the required items in his inventory. This only supports custom items, defined in [Item config](../aurora/item-config.md)and basic vanilla item ids (`minecraft:coal` for example). List your items separated by spaces and add /number at the end to specify how many of that item the player should have in his inventory.

```yaml
[has-items] oraxen:some_item/32 mythicmobs:super_sword/1
```

## Placeholder

Check placeholder comparisons. Requires PlaceholderAPI. `==` compares the values as text, while `===`, `>=`, `<=`, `>` and `<` compare them as numbers. The right side can contain placeholders as well.

```
[placeholder] %some_placeholder% == some value
[placeholder] %some_number_placeholder% === some number value
[placeholder] %some_number_placeholder% >= 10
[placeholder] %some_number_placeholder% <= 10
[placeholder] %some_number_placeholder% > 10
[placeholder] %some_number_placeholder% < 10
```

## Argument

Check menu argument comparisons. Uses the same comparison operators as the placeholder requirement.

```yaml
[arg] some_arg == some value
[arg] some_number_arg === some number value
[arg] some_number_arg >= 10
[arg] some_number_arg <= 10
[arg] some_number_arg > 10
[arg] some_number_arg < 10
```

## Meta

Check the player's meta values (see [Commands](../aurora/commands.md) and the meta actions in [Command dispatcher](../aurora/command-dispatcher.md)). Uses the same comparison operators as the placeholder requirement. If a meta value doesn't exist, it counts as an empty text or `0`.

```yaml
[meta] some_meta_key == some value
[meta] some_number_meta_key === some number value
[meta] some_number_meta_key >= 10
[meta] some_number_meta_key <= 10
[meta] some_number_meta_key > 10
[meta] some_number_meta_key < 10
```

# API Usage

You can register your own requirements to use it everywhere in the menus.

:::callout{type="warning"}
Prefix can't contain spaces! First arg will always be the prefix.
:::

```java
AuroraAPI.registerRequirementHandler("my-requirement", (player, args) -> {
  // You need to return a boolean here. args is a String array,
  // args[0] is the prefix itself, eg: "[my-requirement]"
  return args.length > 2;
});
```

Then you can use it in your menus like:

```yaml
view-requirements:
  - "[my-requirement] arg1 arg2 arg3"
```
