# Flags

## General Information <a href="#general-information" id="general-information"></a>

In this section you will be able to customize the flags menu item, since by default **RED\_BANNER** will be used.

### DisplayName

If you include the `display_name` path: , you can modify the name to be displayed in the flags menu.

```yaml
display_name: "Greetings"
```

***

### Description format <a href="#description-format" id="description-format"></a>

```yaml
    description: |-
      &7The message that appears in
      &7chat upon entering the region.
```

```yaml
    description: "&7The message that appears in \n &7chat upon entering the region."
```

**If the flag appears with a red banner, it indicates that the flag configuration was not found in the flags.yml file. To address this, simply create the configuration section and reload the plugin.**

### **Configuration Section:**

```yaml
flags:
  greeting:  # Flag name
    material: BOOK  # Material of the item representing the flag
    amount: 1  # Item quantity
    glowing: false  # Whether the item should glow
    item_flags:
      - HIDE_ATTRIBUTES  # Item flag, you can add others like HIDE_ENCHANTMENTS
    model_data: 0  # Model data (if using a custom model)
    display_name: "Greetings"  # Name to be shown in the flags menu
    description: |-
      &7The message that appears
      &7in chat when entering the region.
```

#### Explanation of Each Field

1. **`material`**:\
   Defines the material used to represent the flag in the menu. For example, you can use `BOOK`, `DIAMOND_SWORD`, `RED_BANNER`, etc.
2. **`amount`**:\
   Specifies the number of items to display. Default is `1`.
3. **`glowing`**:\
   If set to `true`, the item will have a glowing effect. Useful to highlight certain flags.
4. **`item_flags`**:\
   You can add various item flags here like `HIDE_ATTRIBUTES` or `HIDE_ENCHANTMENTS` to hide attributes or enchantments in the menu item.
5. **`model_data`**:\
   If you are using custom models, this field specifies the model ID.
6. **`display_name`**:\
   Allows you to customize the name displayed in the flags menu. If not set, the default flag name will be used.
7. **`description`**:\
   The description shown in the item's lore inside the menu. You can use formats like `&7` for color and text style. Line breaks can be added using  or YAML's `|-` or `|` notation for better control.

## Placeholders Explanation - Flags Menu

This section explains how the and placeholders work within the flag menu configuration.

```yaml
flags:

  # The title of the inventory.
  name: "&8☀ Flags Editor - [<page> / <totalpages>]"

  # The size of the inventory.
  # Must be a multiple of 9. (9, 18, 27, 36, 45, 54)
  size: 54

  # In this section you will not be able to add new items to the menu, only edit the current ones.
  # If you want to add more items use the custom-items section:
  items:
    icons:
      # These will be the slots in which the flags will be automatically placed.
      slot: 10,11,12,13,14,15,16,19,20,21,22,23,24,25,28,29,30,31,32,33,34,37,38,39,40,41,42,43
      display_name: '&aEdit Flag <flag>'
      click_type:
        - left;groups
        - right;flag
      # - both;groups
      # - drop;flag
      lore:
        - "&8ᴄᴏɴғɪɢᴜʀᴀʙʟᴇ ғʟᴀɢ"
        - ""
        - "&7 <description>"
        - ""
        - "&6 ☀ ɪɴғᴏʀᴍᴀᴛɪᴏɴ"
        - "&8➞ &fState: &a<state>"
        - "&8➞ &fGroup: &a<group>"
        - ""
    clicked:
      textflag: "&e► Click to add a text!"
      drop: "&e► Drop - Toggle groups!"
      both: "&e► Right click - Activate or deactivate the flag!"
      left: "&e► Left Click - Toggle groups!"
      right: "&e► Right click - Activate or deactivate the flag!"
      noperms: "&c► You do not have permissions"
```

***

### `<state>`

The `<state>` placeholder dynamically displays the **current status** of a flag (such as PvP, Build, Chest Access, etc.) based on the flag's current value.

Each flag defines how its states look in the `flags.yml` file under `display_states`, like this:

```yaml
display_states:
  ALLOW: "&a✔ Allowed"
  DENY: "&c❌ Forbidden"
  NONE: "&7❓Undefined"
```

Depending on the protection's current flag value:

* **ALLOW** → Displays as: ✔ Allowed (green)
* **DENY** → Displays as: ❌ Forbidden (red)
* **NONE** → Displays as: ❓Undefined (gray)

***

### `<group>`

The `<group>` placeholder displays **to which group of players** the flag rule is applied.

Group names are defined in the `config.yml` file under `default-flag-groups`, for example:

```yaml
default-flag-groups:
  all: "&7Everyone"
  members: "&aMembers"
  owners: "&6Owners"
  nonmembers: "&cNon-Members"
  nonowners: "&cNon-Owners"
```

Meaning:

* **all** → Everyone
* **members** → Players listed as protection members
* **owners** → Players listed as protection owners
* **nonmembers** → Players who are NOT members
* **nonowners** → Players who are NOT owners

***

## Configuring `click_type` for Flag Items

This section explains how the `click_type` configuration works for flag items in the flags menu.

***

### What is `click_type`?

`click_type` defines **how players interact with a flag item** inside the menu, depending on the mouse button or key they press.

Each interaction is linked to an action, allowing players to:

* Edit the **flag's group** (who the rule applies to)
* Toggle the **flag's state** (allow/deny)

***

### Format

Each entry in `click_type` follows this format: `<click_action>;<target_action>`

* **click\_action**: The mouse or key event.
* **target\_action**: The behavior to trigger.

#### Available click actions:

| Action  | Description                        |
| ------- | ---------------------------------- |
| `left`  | Left mouse click                   |
| `right` | Right mouse click                  |
| `both`  | Left and Right click               |
| `drop`  | Drop key (usually 'Q' on keyboard) |

#### Available target actions:

| Action   | Description                                                      |
| -------- | ---------------------------------------------------------------- |
| `groups` | Opens or toggles the flag group selector (e.g., Members, Owners) |
| `flag`   | Toggles the flag's state (Allow, Deny, None)                     |

***

Meaning:

* **Left-click** → Open or toggle the group selection.
* **Right-click** → Toggle the flag between Allowed / Denied / Undefined.

***

## Full Flags Configuration

```yaml
flags:

  greeting:
    material: BOOK
    amount: 1
    glowing: false
    item_flags:
      - HIDE_ATTRIBUTES
    model_data: 0
    display_name: Greetings
    description: |-
      &7 The message that appears in 
      &7 chat when entering the region.

  greeting-title:
    material: PAINTING
    amount: 1
    glowing: false
    item_flags:
      - HIDE_ATTRIBUTES
    model_data: 0
    description: |-
      &7 The title that appears when entering the
      &7 region. Use (\\n) to send a subtitle.

  greeting-action:
    material: PAPER
    amount: 1
    glowing: false
    item_flags:
      - HIDE_ATTRIBUTES
    model_data: 0
    description: |-
      &7 The title that appears when entering the 
      &7 region. Use (\\n) to send a subtitle.

  farewell:
    material: BOOK
    amount: 1
    glowing: false
    item_flags:
      - HIDE_ATTRIBUTES
    model_data: 0
    description: |-
      &7 The message that appears in 
      &7 chat when leaving the region.

  farewell-title:
    material: PAINTING
    amount: 1
    glowing: false
    item_flags:
      - HIDE_ATTRIBUTES
    model_data: 0
    description: |-
      &7 The title that appears when leaving the
      &7 region. Use (\\n) to send a subtitle.

  farewell-action:
    material: PAPER
    amount: 1
    glowing: false
    item_flags:
      - HIDE_ATTRIBUTES
    model_data: 0
    description: |-
      &7 The title that appears when leaving the 
      &7 region. Use (\\n) to send a subtitle.

  pvp:
    material: NETHERITE_SWORD
    amount: 1
    glowing: false
    item_flags:
      - HIDE_ATTRIBUTES
    display_states:
      ALLOW: "&a✔ Allowed"
      DENY: "&c❌ Forbidden"
      NONE: "&7❓Undefined"
    model_data: 0
    description: |-
      &7 Whether player versus player 
      &7 combat is allowed.

  leaf-decay:
    material: OAK_LEAVES
    amount: 1
    glowing: false
    item_flags:
      - HIDE_ATTRIBUTES
    display_states:
      ALLOW: "&a✔ Allowed"
      DENY: "&c❌ Forbidden"
      NONE: "&7❓Undefined"
    model_data: 0
    description: '&7 Whether leaves will decay.'

  mob-spawning:
    material: ALLAY_SPAWN_EGG
    amount: 1
    glowing: false
    item_flags:
      - HIDE_ATTRIBUTES
    display_states:
      ALLOW: "&a✔ Allowed"
      DENY: "&c❌ Forbidden"
      NONE: "&7❓Undefined"
    model_data: 0
    description: '&7 Whether mobs can spawn.'


  creeper-explosion:
    material: CREEPER_HEAD
    amount: 1
    glowing: false
    item_flags:
      - HIDE_ATTRIBUTES
    display_states:
      ALLOW: "&a✔ Allowed"
      DENY: "&c❌ Forbidden"
      NONE: "&7❓Undefined"
    model_data: 0
    description: '&7 Whether creepers can cause damage.'

  wither-damage:
    material: WITHER_SKELETON_SKULL
    amount: 1
    glowing: false
    item_flags:
      - HIDE_ATTRIBUTES
    display_states:
      ALLOW: "&a✔ Allowed"
      DENY: "&c❌ Forbidden"
      NONE: "&7❓Undefined"
    model_data: 0
    description: |-
      &7 Whether withers can cause damage 
      &7 (with their body explosions).

  ghast-fireball:
    material: GHAST_TEAR
    amount: 1
    glowing: false
    item_flags:
      - HIDE_ATTRIBUTES
    display_states:
      ALLOW: "&a✔ Allowed"
      DENY: "&c❌ Forbidden"
      NONE: "&7❓Undefined"
    model_data: 0
    description: |-
      &7 Whether ghasts, fireballs, and wither 
      &7 skulls can cause damage.

  entity-item-frame-destroy:
    material: ITEM_FRAME
    amount: 1
    glowing: false
    item_flags:
      - HIDE_ATTRIBUTES
    display_states:
      ALLOW: "&a✔ Allowed"
      DENY: "&c❌ Forbidden"
      NONE: "&7❓Undefined"
    model_data: 0
    description: |-
      &7 Whether non-player entities 
      &7 can destroy item frames.

  entry:
    material: IRON_BARS
    amount: 1
    glowing: false
    item_flags:
      - HIDE_ATTRIBUTES
    display_states:
      ALLOW: "&a✔ Allowed"
      DENY: "&c❌ Forbidden"
      NONE: "&7❓Undefined"
    model_data: 0
    description: '&7 Whether players can enter the region.'

  use:
    material: OAK_DOOR
    amount: 1
    glowing: false
    item_flags:
      - HIDE_ATTRIBUTES
    display_states:
      ALLOW: "&a✔ Allowed"
      DENY: "&c❌ Forbidden"
      NONE: "&7❓Undefined"
    model_data: 0
    description: |-
      &7 Whether doors, levers, etc. 
      &7 (but not inventories) can be used.

  block-trampling:
    material: WHEAT
    amount: 1
    glowing: false
    item_flags:
      - HIDE_ATTRIBUTES
    display_states:
      ALLOW: "&a✔ Allowed"
      DENY: "&c❌ Forbidden"
      NONE: "&7❓Undefined"
    model_data: 0
    description: |-
      &7 Whether farmland and turtle eggs 
      &7 \n&7 can be trampled.

  pistons:
    material: STICKY_PISTON
    amount: 1
    glowing: false
    item_flags:
      - HIDE_ATTRIBUTES
    display_states:
      ALLOW: "&a✔ Allowed"
      DENY: "&c❌ Forbidden"
      NONE: "&7❓Undefined"
    model_data: 0
    description: '&7 Whether pistons can be used.'

  chest-access:
    material: CHEST
    amount: 1
    glowing: false
    item_flags:
      - HIDE_ATTRIBUTES
    display_states:
      ALLOW: "&a✔ Allowed"
      DENY: "&c❌ Forbidden"
      NONE: "&7❓Undefined"
    model_data: 0
    description: '&7 Whether inventories can be accessed.'

  fire-spread:
    material: CAMPFIRE
    amount: 1
    glowing: false
    item_flags:
      - HIDE_ATTRIBUTES
    display_states:
      ALLOW: "&a✔ Allowed"
      DENY: "&c❌ Forbidden"
      NONE: "&7❓Undefined"
    model_data: 0
    description: '&7 Whether fire can spread.'

  tnt:
    material: TNT
    amount: 1
    glowing: false
    item_flags:
      - HIDE_ATTRIBUTES
    display_states:
      ALLOW: "&a✔ Allowed"
      DENY: "&c❌ Forbidden"
      NONE: "&7❓Undefined"
    model_data: 0
    description: '&7 Whether TNT detonation or damage is allowed.'

  use-anvil:
    material: ANVIL
    amount: 1
    glowing: false
    item_flags:
      - HIDE_ATTRIBUTES
    display_states:
      ALLOW: "&a✔ Allowed"
      DENY: "&c❌ Forbidden"
      NONE: "&7❓Undefined"
    model_data: 0
    description: '&7 Whether anvils can be used.'

  lightning:
    material: TWISTING_VINES
    amount: 1
    glowing: false
    item_flags:
      - HIDE_ATTRIBUTES
    display_states:
      ALLOW: "&a✔ Allowed"
      DENY: "&c❌ Forbidden"
      NONE: "&7❓Undefined"
    model_data: 0
    description: '&7 Whether lightning can strike.'

  ice-form:
    material: BLUE_ICE
    amount: 1
    glowing: false
    item_flags:
      - HIDE_ATTRIBUTES
    display_states:
      ALLOW: "&a✔ Allowed"
      DENY: "&c❌ Forbidden"
      NONE: "&7❓Undefined"
    model_data: 0
    description: '&7 Whether ice will form.'

  ice-melt:
    material: ICE
    amount: 1
    glowing: false
    item_flags:
      - HIDE_ATTRIBUTES
    display_states:
      ALLOW: "&a✔ Allowed"
      DENY: "&c❌ Forbidden"
      NONE: "&7❓Undefined"
    model_data: 0
    description: '&7 Whether ice will melt.'

  snowman-trails:
    material: CARVED_PUMPKIN
    amount: 1
    glowing: false
    item_flags:
      - HIDE_ATTRIBUTES
    display_states:
      ALLOW: "&a✔ Allowed"
      DENY: "&c❌ Forbidden"
      NONE: "&7❓Undefined"
    model_data: 0
    description: |-
      &7 Whether snow golems will 
      &7 create snow beneath them.

  mob-damage:
    material: COW_SPAWN_EGG
    amount: 1
    glowing: false
    item_flags:
      - HIDE_ATTRIBUTES
    display_states:
      ALLOW: "&a✔ Allowed"
      DENY: "&c❌ Forbidden"
      NONE: "&7❓Undefined"
    model_data: 0
    description: '&7 Whether mobs can hurt players.'

  chorus-fruit-teleport:
    material: CHORUS_FRUIT
    amount: 1
    glowing: false
    item_flags:
      - HIDE_ATTRIBUTES
    display_states:
      ALLOW: "&a✔ Allowed"
      DENY: "&c❌ Forbidden"
      NONE: "&7❓Undefined"
    model_data: 0
    description: |-
      &7 Whether chorus fruits can 
      &7 be used for teleportation.

  enderpearl:
    material: ENDER_PEARL
    amount: 1
    glowing: false
    item_flags:
      - HIDE_ATTRIBUTES
    display_states:
      ALLOW: "&a✔ Allowed"
      DENY: "&c❌ Forbidden"
      NONE: "&7❓Undefined"
    model_data: 0
    description: '&7 Whether ender pearls can be used.'

  use-dripleaf:
    material: BIG_DRIPLEAF
    amount: 1
    glowing: false
    item_flags:
      - HIDE_ATTRIBUTES
    display_states:
      ALLOW: "&a✔ Allowed"
      DENY: "&c❌ Forbidden"
      NONE: "&7❓Undefined"
    model_data: 0
    description: '&7 Whether dripleaf can be used.'

  interact:
    material: LEVER
    amount: 1
    glowing: false
    item_flags:
      - HIDE_ATTRIBUTES
    display_states:
      ALLOW: "&a✔ Allowed"
      DENY: "&c❌ Forbidden"
      NONE: "&7❓Undefined"
    model_data: 0
    description: |-
      &7 Everything that involves 'using' a block or entity:
      &7 Whether doors, levers, etc. can be used
      &7 (but not inventories).
      &7 Whether vehicles (including animals) can be ridden, etc.

  coral-fade:
    material: BUBBLE_CORAL
    amount: 1
    glowing: false
    item_flags:
      - HIDE_ATTRIBUTES
    display_states:
      ALLOW: "&a✔ Allowed"
      DENY: "&c❌ Forbidden"
      NONE: "&7❓Undefined"
    model_data: 0
    description: |-
      &7 Whether coral will die when not in water.

  grass-growth:
    material: GRASS_BLOCK
    amount: 1
    glowing: false
    item_flags:
      - HIDE_ATTRIBUTES
    display_states:
      ALLOW: "&a✔ Allowed"
      DENY: "&c❌ Forbidden"
      NONE: "&7❓Undefined"
    model_data: 0
    description: '&7 Whether grass will grow.'

  sculk-growth:
    material: SCULK_SENSOR
    amount: 1
    glowing: false
    item_flags:
      - HIDE_ATTRIBUTES
    display_states:
      ALLOW: "&a✔ Allowed"
      DENY: "&c❌ Forbidden"
      NONE: "&7❓Undefined"
    model_data: 0
    description: '&7 Whether sculk (sculk and sculk vines) will grow.'

  frosted-ice-form:
    material: DIAMOND_BOOTS
    amount: 1
    glowing: false
    item_flags:
      - HIDE_ATTRIBUTES
    display_states:
      ALLOW: "&a✔ Allowed"
      DENY: "&c❌ Forbidden"
      NONE: "&7❓Undefined"
    model_data: 0
    description: |-
      &7 Whether players with Frost 
      &7 Walker boots will form ice.

file-version: 1
```

```yaml
```


---

# 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/psmenu/flags.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.
