> For the complete documentation index, see [llms.txt](https://yowsef-development.gitbook.io/yowsef-development-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yowsef-development.gitbook.io/yowsef-development-docs/menus/requirements.md).

# requirements

DialogMaster features a condition evaluator that lets you show or hide buttons or block clicks based on PlaceholderAPI variables.

***

## 1. Requirement Types

### View Requirements (`view-requirements`)

Evaluated when the menu is built for a player. If any requirement fails, the button is **completely hidden** from the layout.

```yaml
buttons:
  - label: "<red>Staff Panel"
    view-requirements:
      - "%player_has_permission_staff% == true"
    action: open-menu
    target: staff-menu
```

### Click Requirements (`click-requirements`)

Evaluated when the player clicks the button, before any action runs. If a requirement fails, the click is silently blocked.

```yaml
buttons:
  - label: "<gold>Purchase Speed Boost"
    click-requirements:
      - "%vault_eco_balance% >= 500"
    action: static-run-command
    command: "/effect give %player_name% speed 30 1"
```

{% hint style="info" %}
Requirement keys use hyphens (`view-requirements`, `click-requirements`), not underscores.
{% endhint %}

***

## 2. Comparison Operators

Expressions follow the format `[Value A] [Operator] [Value B]`. Both string and numeric comparisons are supported automatically.

| Operator   | Example                                   |
| ---------- | ----------------------------------------- |
| `==`       | `"%player_has_permission_staff% == true"` |
| `!=`       | `"%vault_eco_balance% != 0"`              |
| `>`        | `"%vault_eco_balance% > 500"`             |
| `>=`       | `"%player_level% >= 30"`                  |
| `<`        | `"%statistic_player_kills% < 100"`        |
| `<=`       | `"%statistic_deaths% <= 5"`               |
| `contains` | `"%luckperms_prefix% contains Vip"`       |

***

## 3. Priority Groups

`priority-groups` lets you define multiple layouts for a single button slot. The engine checks each group top-to-bottom and renders the **first one** whose `view-requirements` all pass. The last group in the list acts as the default fallback (no requirements needed).

Useful for kit cooldown states, rank-gated buttons, and A/B layouts:

```yaml
buttons:
  - label: "Starter Kit"          # This top-level label is ignored when priority-groups is set
    priority-groups:
      # Group 1: shown only while the kit is on cooldown
      - label: "<red>Kit Locked"
        tooltip: "<gray>Cooldown: %essentials_kit_cooldown_starter%"
        view-requirements:
          - "%essentials_kit_is_available_starter% == false"
        action: close

      # Group 2: default — kit is ready
      - label: "<green>Claim Starter Kit"
        tooltip: "<gray>Click to claim your daily kit!"
        action: static-run-command
        command: "/kit starter"
        action-key: "dm:claim_kit"
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://yowsef-development.gitbook.io/yowsef-development-docs/menus/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.
