> 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/examples/cookbook.md).

# cookbook

Complete, ready-to-use menu configuration files. Drop these into `plugins/DialogMaster/menus/` to get started.

{% stepper %}
{% step %}

## Main Navigation Hub

```yaml
# menus/main-menu.yml
main-menu:
  title: "<gold><bold>Donut SMP"
  type: multiAction
  columns: 2
  body:
    - type: plain-message
      content: "<gray>Welcome, <aqua>%player_name%</aqua>!"
    - type: plain-message
      content: "<gray>Balance: <gold>$%vault_eco_balance_formatted%"
  buttons:
    - label: "<green>🏠 Homes"
      width: 150
      action: open-menu
      target: homes-menu
      action-key: "dm:main_menu_open"
    - label: "<gold>🏆 Leaderboards"
      width: 150
      action: open-menu
      target: leaderboard-hub
      action-key: "dm:leaderboard_open"
    - label: "<green>💸 Pay"
      width: 150
      action: open-menu
      target: pay-menu
      action-key: "dm:main_menu_open"
    - label: "<gray>⚙ Settings"
      width: 150
      action: open-menu
      target: settings-menu
      action-key: "dm:main_menu_open"
    - label: "<red>❌ Close"
      width: 150
      action: close
      action-key: "dm:cancel"
```

{% endstep %}

{% step %}

## Homes Manager (Dynamic)

```yaml
# menus/homes-menu.yml
homes-menu:
  title: "<green><bold>🏠 Your Homes"
  type: multiAction
  columns: 2
  body:
    - type: plain-message
      content: "<gray>You have <green>%essentials_homes_count%</green> homes."
  dynamic-buttons: homes
  footer-buttons:
    - label: "<yellow>➕ Set New Home"
      width: 180
      action: open-menu
      target: set-home-menu
      action-key: "dm:sethome"
    - label: "<gray>← Back"
      width: 100
      action: back
      action-key: "dm:back"
```

{% endstep %}

{% step %}

## Pay Menu (Inputs)

```yaml
# menus/pay-menu.yml
pay-menu:
  title: "<green>💸 Send Money"
  type: confirmation
  body:
    - type: plain-message
      content: "<gray>Your balance: <gold>$%vault_eco_balance_formatted%"
  inputs:
    - type: text
      key: "target_player"
      label: "<white>Player Name"
      max-length: 16
      width: 250
    - type: number-range
      key: "pay_amount"
      label: "<white>Amount"
      min: 1.0
      max: 1000000.0
      step: 1.0
      initial: 100.0
      label-format: "Amount: $%s"
      width: 300
  confirm-button:
    label: "<green>Send"
    width: 120
    action: command-template
    command-template: "/pay $(target_player) $(pay_amount)"
    action-key: "dm:pay_confirm"
  deny-button:
    label: "<gray>Cancel"
    width: 100
    action: close
    action-key: "dm:cancel"
```

{% endstep %}

{% step %}

## Leaderboard Hub

```yaml
# menus/leaderboard-hub.yml
leaderboard-hub:
  title: "<gold><bold>🏆 Leaderboards"
  type: multiAction
  columns: 2
  body:
    - type: plain-message
      content: "<gray>Choose a leaderboard below."
  buttons:
    - label: "<gold>💰 Money"
      width: 150
      action: open-lb
      target: money
      action-key: "dm:leaderboard_open"
    - label: "<red>☠ Kills"
      width: 150
      action: open-lb
      target: kills
      action-key: "dm:leaderboard_open"
    - label: "<aqua>⏱ Playtime"
      width: 150
      action: open-lb
      target: playtime
      action-key: "dm:leaderboard_open"
    - label: "<yellow>⛏ Mining"
      width: 150
      action: open-lb
      target: blocks-broken
      action-key: "dm:leaderboard_open"
    - label: "<gray>← Back"
      width: 100
      action: back
      action-key: "dm:back"
```

{% endstep %}

{% step %}

## Kit Preview (Item body + Requirements)

```yaml
# menus/kit-preview-menu.yml
kit-preview-menu:
  title: "<gold>⚔ Kit: Warrior"
  type: confirmation
  body:
    - type: item
      material: DIAMOND_SWORD
      name: "<aqua>Warrior Sword"
      lore:
        - "<gray>Sharpness V, Unbreaking III"
      show-decorations: true
      show-tooltip: true
      width: 64
      height: 64
    - type: plain-message
      content: "<gray>Cooldown: <yellow>%dialogmaster_kit_warrior_cooldown%"
  confirm-button:
    label: "<green>Claim Kit"
    width: 140
    action: static-run-command
    command: "/kit warrior"
    action-key: "dm:claim_kit"
    click-requirements:
      - "%essentials_kit_is_available_warrior% == true"
  deny-button:
    label: "<gray>Cancel"
    width: 100
    action: close
    action-key: "dm:cancel"
```

{% endstep %}

{% step %}

## Priority Groups — Kit Cooldown State

```yaml
buttons:
  - label: "Warrior Kit"
    priority-groups:
      # Shown only while the kit is on cooldown
      - label: "<red>⏳ Kit Locked"
        tooltip: "<gray>Cooldown: %essentials_kit_cooldown_warrior%"
        width: 150
        view-requirements:
          - "%essentials_kit_is_available_warrior% == false"
        action: close

      # Default — kit is ready
      - label: "<green>⚔ Claim Kit"
        tooltip: "<gray>Click to claim the Warrior kit"
        width: 150
        action: static-run-command
        command: "/kit warrior"
        action-key: "dm:claim_kit"
```

{% endstep %}
{% endstepper %}


---

# 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/examples/cookbook.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.
