# Menu Customization

## 🛠️ Shop Configuration

This guide explains how to set up categories, buttons, and integrate custom items within ShopMaster's shop system. You'll also learn how to use actions, slots, and custom behavior.

***

### 📑 Table of Contents

* Shop Configuration Basics
* Category Setup
* Button System
  * Default Buttons
  * Category-Specific Customization
  * Button Properties
* Items
  * Material Sources
  * Item Flags
* Custom Items
* Slots
* Actions
  * Sub Actions

***

### 📘 Shop Configuration Basics

Each shop starts with a base structure like this:

```yaml
shop_name:
  enable: true
  title: '&8☀ Shop | &lWEAPONS'
  size: 54
```

***

### 🗂️ Category Setup

Categories are used to organize shops and are shown in the main menu.

```yaml
shop_name:
  # Basic shop config...

  category:
    material: DIAMOND_SWORD
    slot: 12
    amount: 1
    model_data: 0
    display_name: '&bWeapons Shop'
    glowing: true
    item_flags:
      - HIDE_ATTRIBUTES
      - HIDE_ENCHANTS
    lore:
      - '&8ᴄᴀᴛᴇɢᴏʀɪᴇs'
      - ''
      - '&8 ● &fPurchase powerful weapons'
      - '&8 ● &fMagical and physical damage'
      - ''
      - '&e► Click to open the menu!'
```

***

## 🔘 Button System

You can create buttons for navigation and shop control.

### 🔄 Default Buttons (from `layouts.yml`)

```yaml
buttons:
  next:
    enabled: true
    material: ARROW
    slot: 50
    amount: 1
    display_name: '&cNext page'
    item_flags: [HIDE_ATTRIBUTES]
    glowing: false
    lore: []

  previous:
    enabled: true
    material: ARROW
    slot: 48
    amount: 1
    display_name: '&cPrevious page'
    item_flags: [HIDE_ATTRIBUTES]

  close:
    enabled: true
    material: BOOK
    slot: 49
    display_name: '&cClose'

  back:
    enabled: true
    material: ARROW
    slot: 46
    display_name: '&cBack'

  indicator:
    enabled: true
    material: NETHER_STAR
    slot: 4
    display_name: '&eCurrent'
```

### 🧩 Category-Specific Customization

You can override default buttons within any category:

```yaml
tools:
  enable: true
  title: '&8☀ Shop | &lTOOLS'
  size: 54

  category:
    # ...

  buttons:
    next:
      enabled: true
      material: SPECTRAL_ARROW
      slot: 50
      display_name: '&aNext Page'
      glowing: true
```

If no custom buttons are defined, the defaults from `layouts.yml` will apply.

***

### ⚙️ Button Properties

Each button supports the following options:

* `enabled`: Enable/disable the button
* `material`: Item to use (e.g. `ARROW`, `BOOK`)
* `slot`: Position in the inventory (0–53)
* `amount`: Stack size
* `model_data`: Resource pack model support
* `display_name`: Custom name (with color codes)
* `glowing`: Enchantment glow effect
* `item_flags`: Hide item attributes
* `lore`: Description lines

***

## 🎨 Items

This section lets you **edit** existing items, not add new ones. To add new items, use the `custom-items` section.

### 🎯 Material Sources

* `DIAMOND`
* `basehead-<base64>`
* `texture-<id>` *(from `textures.minecraft.net/textures/...`)*
* `hdb-<ID>` *(HeadDatabase)*
* `itemsadder-namespace:name`
* `oraxen-oraxen_item_id`

### 🏷️ Item Flags

Hide item data for cleaner looks:

```yaml
item_flags:
  - HIDE_ATTRIBUTES
```

***

## 🧱 Custom Items

Define new items using unique IDs:

```yaml
custom-items:
  close:
    material: BOOK
    amount: 1
    display_name: '&cClose'
    slot: 49
    lore: [ ]
    actions:
      - "[close]"
```

You can define as many custom items as needed. Use the `actions` section to make them functional.

***

## 🧩 Slots

Control where items appear:

```yaml
slot: 10         # Slot 10 only
slots: [1-10]    # Range from 1 to 10
slots:           # List of specific slots
  - 1
  - 2
  - 3
```

***

## ⚡ Actions

Actions add functionality to buttons and items. You can:

* Run commands
* Send messages, titles, or sounds
* Close menus
* Broadcast to all players
* Delay actions
* Use placeholders (e.g., `%player_name%` or `{player}`)

```yaml
actions:
  - "[command] eco give {player} 10000 <delay=40>"
  - "[message] &aYou have claimed your reward"
  - "[title] &a&lCLAIMED;&fsuccess;10;20;10"
  - "[sound] BLOCK_NOTE_BLOCK_HARP;1.0f;1.0f"
  - "[broadcast] &8» &e{player} &7has claimed a reward"
  - "[close]"
```

📌 PlaceholderAPI is required for placeholders. Run:

```bash
/papi ecloud download Player
```

***

## 🧪 Sub Actions

Use multiple actions with conditions:

```yaml
actions:
  - "[chance=50] [command] say Hi %player_name%"
  - "[command] say Welcome %player_name% <delay=20>"
```

> The space between `[chance=...]` and `[command]` is required.

***

Let me know if quieres que esto se divida por páginas en GitBook como `category-setup.md`, `buttons.md`, `custom-items.md`, etc. para una navegación más organizada.


---

# Agent Instructions: 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://docs.xshyo.us/premium-plugins/shopmaster/menu-customization.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.
