# 🔒 Requirements

> **Info:**
This feature is only available with the Premium Plan.

Requirements are checks a purchase or a sale of this item has to pass before it goes through, such as a permission, a world or a placeholder value. They are read before the stock limits, so a player who does not meet them is refused before they are told the item is sold out.

## Add a Requirement

Left-click the lime stained glass to add a check. It is named `check_<number>`, starts as a **permission** check, and its editor opens straight away. Every check in the list shows its type, what it checks and what it applies to. Left-click one to edit it, right-click it to delete it, together with its deny actions, after a confirmation.

<figure><img src="../../.gitbook/assets/requirements/requirements.png" alt="" width="563"><figcaption><p>Edit Item (Requirements)</p></figcaption></figure>

<figure><img src="../../.gitbook/assets/requirements/add-a-requirement.png" alt="" width="563"><figcaption><p>Requirements (New Requirement)</p></figcaption></figure>

## Minimum

How many of the checks have to pass. At 0 it shows **All Requirements**, and every check has to pass. Only the checks that apply to the transaction are counted, so a minimum higher than that number asks for all of them.

<figure><img src="../../.gitbook/assets/requirements/minimum.png" alt="" width="563"><figcaption><p>Requirements (Minimum)</p></figcaption></figure>

## Type

Which check this is. Only the fields the chosen type reads are shown.

<figure><img src="../../.gitbook/assets/requirements/type.png" alt="" width="563"><figcaption><p>Requirement (Type)</p></figcaption></figure>

| Type | Fields | Passes when |
| --- | --- | --- |
| permission | Permission | The player has the permission. |
| compare | Input, Operator, Output | Input compared to Output with the operator holds true. |
| world | World | The player is in that world, picked from the server's loaded worlds. |
| gamemode | Gamemode | The player is in that gamemode, picked from the list. |
| holding | Held Item, Item Name, Whole Inventory | The player holds that item in their main hand. Drop the item on the slot to set it; with none set, any held item passes. A custom item from ItemsAdder, Nexo, CraftEngine and the other supported plugins is saved by its id, such as `nexo:ruby_pickaxe`, and only that item passes. A plain material such as `DIAMOND_PICKAXE` does not count custom items built on it. With Item Name set, the item's name has to match it exactly, colors ignored. With Whole Inventory on, an item anywhere in the main inventory or hotbar counts, armor and off-hand excluded. |
| enchantment | Enchantment | The player holds an item in their main hand that can take the enchantment, picked from a filterable list of every vanilla enchantment. |
| platform | Platform | The player joined from that platform, Bedrock (through Floodgate or Geyser) or Java. |
| region | Region | The player stands inside that [WorldGuard](https://enginehub.org/worldguard) region. Only offered when WorldGuard is installed. |
| world-time | World Time | The time of day in the player's world is inside the range, both ends included, such as `08:00-14:45`. Tick 0 reads as 06:00, so `/time set noon` is 12:00 and `/time set midnight` is 00:00. A range such as `22:00-06:00` runs past midnight. |
| playtime | Playtime | The player has played at least that long on this server, such as `15m`, `12h` or `5d 12h`. Days, hours, minutes and seconds can be combined. |

## Operator

How a **compare** check weighs Input against Output. `>`, `>=`, `==`, `!=`, `<` and `<=` compare them as numbers. `equals`, `equals ignorecase`, `contains` and `not contains` compare them as text. Input and Output accept PlaceholderAPI placeholders, such as `%player_level%` against `30`.

## Negate

Flips the check, so it passes when it would fail. A negated **permission** check passes for players without the permission, and a negated **platform** check set to Bedrock passes for Java players.

<figure><img src="../../.gitbook/assets/requirements/negate.png" alt="" width="563"><figcaption><p>Requirement (Negate)</p></figcaption></figure>

> **Warning:**
A check that cannot be evaluated refuses the transaction, negated or not: a placeholder with PlaceholderAPI not installed, a number operator where either side is not a number, a gamemode or platform that does not exist, an unreadable time range or playtime, a region check with WorldGuard not installed, an unknown operator or an unknown type. The console says why, once per check.

## Applies To

Whether the check runs on buying, on selling, or on both, which is the default. A check that does not apply to a transaction is ignored for it, and does not count towards the [Minimum](#minimum).

<figure><img src="../../.gitbook/assets/requirements/applies-to.png" alt="" width="563"><figcaption><p>Requirement (Applies To)</p></figcaption></figure>

## Deny Actions

Actions run when this check fails and the transaction is refused, such as a message telling the player what they are missing, a sound or a title. When several checks fail, each one runs its own deny actions.

<figure><img src="../../.gitbook/assets/requirements/deny-actions.png" alt="" width="563"><figcaption><p>Requirement (Deny Actions)</p></figcaption></figure>

> **Info:**
A refused transaction sends no message of its own, only the shop's [deny actions](../shops/edit-shop.md#actions), a sound by default. Use deny actions to tell the player why.

Source: https://www.phoenixplugins.com/docs/phoenix-shop/main-features/items/requirements