> For the complete documentation index, see [llms.txt](https://realisticnode.gitbook.io/rnsetups/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://realisticnode.gitbook.io/rnsetups/rnpsmenu/guides/flags.md).

# Flags and templates

Which flags players can change, rnPsMenu's own flags, flags kept for better blocks, templates and the anti-trap lock.

## Which flags appear

The flags menu shows **one list** with every flag the player can change in the region:

* the **`allowed_flags` of the region's block type** in ProtectionStones (`plugins/ProtectionStones/blocks/*.toml`);
* plus the flags of **`flags.extra-allowed`** in `config.yml`, in every region. By default: [rnPsMenu's own flags](#rnpsmenus-own-flags) and the usual WorldGuard flags (build, chest-access, entry, tnt, greeting...).

rnPsMenu knows **124 flags** (85 of WorldGuard and its own 39), each with an icon, a name and a description in English and Spanish. By default 105 of them can be changed in every region; the other 19 (pvp, game-mode, exit, heal and feed, chat and command flags...) appear when the block type allows them or you add them to `extra-allowed`. The list follows the order of `flags.yml`; flags not listed there go at the end.

```toml
allowed_flags = [
    "-g all pvp",          # pvp, only for everyone
    "greeting",
    "entry",
    "-g members,nonmembers build",
    "game-mode",
]
```

`-g` limits which groups a flag can apply to. Flags of `extra-allowed` can apply to every group, unless the block type also lists them with `-g`. A player also needs `protectionstones.flags.edit.<flag>` (ProtectionStones gives it to everyone by default).

```yaml
flags:
  extra-allowed:
    - crafting-table-use
    - villager-trade
    - build
    - greeting
    # [] = only ProtectionStones' allowed_flags
```

Flags that don't exist in your WorldGuard version are skipped. Left out on purpose: exit, invincible, game-mode, heal/feed, chat and command flags (they can trap visitors or give advantages). Add them if you want them.

{% hint style="info" %}
Flags of `extra-allowed` are changed from the menus. ProtectionStones' own `/ps flag <flag> <value>` only knows the `allowed_flags` of the block type.
{% endhint %}

Greetings, farewells, their titles and action bars, and `deny-message` get colors the same way in the menu and with `/ps flag greeting <text>`: `&` codes, hex (`&#3fd0ff`) and MiniMessage (`<gold>`) all become real colors.

`time-lock`, `weather-lock`, `game-mode`, `invincible` and the greeting and farewell action bars apply at once to the players already inside, whether you change them from the menu or with `/ps flag` or `/rg flag` (from the console too). WorldGuard on its own applies them the next time someone crosses the border. Remove a time or weather lock and whoever is inside sees the world's time and weather again.

`wither-damage` set to deny also stops wither skulls from breaking blocks in the region (WorldGuard on its own lets them through).

To hide a flag from the menu without changing ProtectionStones, set `hidden: true` for it in `flags.yml`, or click it in `/psmenu editor > Flags`. The icon of each flag is also set there; `icon: CRAFTER|DISPENSER` uses the second item when the first one doesn't exist in your Minecraft version. Names and descriptions are in the language files under `flags`.

## rnPsMenu's own flags

rnPsMenu adds **39 flags** to WorldGuard for things WorldGuard has no flag for. They are normal WorldGuard flags: they also work in ProtectionStones' `allowed_flags` and with `/rg flag`.

* **Deny**: blocked for players who are not members (the default group). **Owners and members are never stopped**, unless the owner changes the group with a right click.
* **Allow**: for the flags that use a block (crafting tables, furnaces, jukeboxes, composters, cauldrons with buckets, campfires...), for the mob flags (`villager-trade`, `leash-use`...) and for `bone-meal-use` and `spawn-egg-use`, visitors may do it **even where WorldGuard's protection would block it**. Only that: placing and breaking blocks stay blocked, and an egg or bone meal never works on a spawner or on a block that is used (a chest stays a chest). Handy for a shop with a free crafting table. Allow only lifts WorldGuard's own protection: if a lock plugin (LWC, Bolt...), a shop plugin or any other plugin refuses the click, that plugin still wins.
* **Not set**: nothing changes; WorldGuard's normal protection applies.
* Players who bypass WorldGuard (`worldguard.region.bypass.<world>`) are never stopped.
* The flags about the world (`phantom-spawn`, `wither-spawn`, `mob-crop-trample`, `map-marker`) apply to everyone: no player is involved.
* Blocks, items and mobs that don't exist in your Minecraft version (crafters, vaults, shelves, copper chests...) are simply skipped, so the same list works from 1.21.1 to 26.3.

**Players**

| Flag                | What it controls                                                              |
| ------------------- | ----------------------------------------------------------------------------- |
| `elytra-glide`      | Flying with elytra, also gliding in from outside                              |
| `nether-portal-use` | Nether portals inside the region (not end portals or gateways), also on Folia |

**What visitors may use**

| Flag                     | What it controls                                                             |
| ------------------------ | ---------------------------------------------------------------------------- |
| `ender-chest-use`        | Opening ender chests                                                         |
| `crafting-table-use`     | Crafting tables                                                              |
| `furnace-use`            | Furnaces, smokers and blast furnaces                                         |
| `enchanting-table-use`   | Enchanting tables                                                            |
| `brewing-stand-use`      | Brewing stands                                                               |
| `beacon-use`             | Changing beacon effects                                                      |
| `workstation-use`        | Stonecutters, looms, grindstones, cartography, smithing and fletching tables |
| `crafter-use`            | Crafters                                                                     |
| `vault-use`              | Trial chamber vaults                                                         |
| `lectern-use`            | Reading and taking books from lecterns                                       |
| `chiseled-bookshelf-use` | Putting and taking books                                                     |
| `shelf-use`              | Putting and taking items on shelves                                          |
| `copper-chest-use`       | Copper chests                                                                |
| `decorated-pot-use`      | Putting items in decorated pots                                              |
| `jukebox-use`            | Playing and taking discs                                                     |
| `note-block-use`         | Changing the note of note blocks                                             |
| `bell-use`               | Ringing bells                                                                |
| `composter-use`          | Composters                                                                   |
| `cauldron-use`           | Filling and emptying cauldrons                                               |
| `campfire-use`           | Cooking on campfires                                                         |
| `flower-pot-use`         | Putting and taking plants                                                    |
| `bone-meal-use`          | Using bone meal on blocks                                                    |
| `spawn-egg-use`          | Using spawn eggs: on blocks, on water, in the air and on mobs                |

**Animals and entities**

| Flag                 | What it controls                                                |
| -------------------- | --------------------------------------------------------------- |
| `villager-trade`     | Trading with villagers and wandering traders                    |
| `animal-breed`       | Feeding animals to breed them                                   |
| `mount-chest-access` | Chests of donkeys, mules, llamas and boats                      |
| `leash-use`          | Putting leads on animals and taking them off (also from fences) |
| `name-tag-use`       | Naming mobs                                                     |
| `shear-use`          | Shearing sheep and other mobs                                   |
| `mob-bucket-use`     | Catching fish and axolotls in buckets                           |
| `fishing-hook`       | Pulling mobs and players with a fishing rod                     |
| `armor-stand-use`    | Taking or putting items on armor stands                         |

**Mobs**

| Flag               | What it controls      |
| ------------------ | --------------------- |
| `phantom-spawn`    | Phantoms spawn        |
| `wither-spawn`     | Building the wither   |
| `raid-trigger`     | Bad Omen starts raids |
| `mob-crop-trample` | Mobs trample farmland |

**Map**

| Flag         | What it controls                                                                                     |
| ------------ | ---------------------------------------------------------------------------------------------------- |
| `map-marker` | The region is shown on the web map; deny hides it. See [Web maps](/rnsetups/rnpsmenu/guides/maps.md) |

## Flags kept for better blocks or ranks

In `flags.yml` a flag can be kept for some block types or for a permission:

<figure><img src="https://i.imgur.com/hxCisdX.png" alt="A flag locked for this block type, with a link to the shop"><figcaption><p>A flag locked for this block type, with a link to the shop</p></figcaption></figure>

```yaml
flags:
  villager-trade:
    icon: EMERALD
    types: [diamond, emerald]        # only regions of these block types
  greeting-title:
    icon: NAME_TAG
    permission: myserver.vip         # any permission you choose
```

* `types`: ProtectionStones block types, by alias or block (like `diamond_block`).
* `permission`: the permission needed to change the flag. It is your own permission (give it with your permissions plugin, for example to a VIP rank).
* Everyone else sees the flag **locked**: the lore says which blocks unlock it, or that a higher rank is needed.
* Clicking a flag locked by `types` **opens the protection shop**, so the player can buy a better block (when the shop is on, the server has an economy and the player has `rnpsmenu.shop`). Otherwise a message explains why it is locked.
* Templates and **Copy from another region** skip locked flags, and ProtectionStones' own `/ps flag <flag> <value>` refuses them too.

`types` and `permission` are set in `flags.yml` (the in-game editor only changes icons and hidden flags).

## Anti-trap lock

```yaml
flags:
  cooldown-seconds: 2
  lock-while-visitors-inside: [pvp, entry, exit, invincible, fall-damage, lava-flow]
  notify-players-inside: false
  lock-pvp-group: true
```

* The flags of `lock-while-visitors-inside` can't change while someone who is not an owner or member is inside the region, so nobody can lure players in and turn pvp on under them. `rnpsmenu.bypass.lock` skips it.
* `cooldown-seconds`: time before the same flag of the same region changes again (`0` = no wait). Staff with `rnpsmenu.bypass.cooldown` never wait.
* `entry` and `exit` can never be denied to a group with the owners (everyone, members, owners): the owner would lock themselves out of their own region. Denied, they apply to non-members; players who may no longer be inside are moved just outside, with a message.
* `notify-players-inside`: tells the players inside when a flag changes.
* `lock-pvp-group`: pvp never changes group (members, non-members...), like in `/ps flag`. pvp also can't be removed when the block type gives it a value.

## Templates

**Region menu > Flag templates** applies a set of flags at once. The defaults are Private, Public, Shop, Farm and Peaceful (`presets.yml`):

<figure><img src="https://i.imgur.com/Qkxt8Nj.png" alt="Templates: each one lists the flags it sets"><figcaption><p>Templates: each one lists the flags it sets</p></figcaption></figure>

```yaml
presets:
  private:
    icon: IRON_DOOR
    permission: ''
    flags:
      - "pvp deny"
      - "-g nonmembers entry deny"
      - "-g nonmembers use deny"
      - "-g nonmembers chest-access deny"
      - "creeper-explosion deny"
      - "tnt deny"
```

Each line is written like ProtectionStones' `flags`: `flag value`, `-g group flag value`, or `flag none` to remove the value. `permission` is needed to use the template (`''` = everyone with `rnpsmenu.presets`).

Templates need `rnpsmenu.presets` and `protectionstones.flags`, and are used by owners and by [operators](/rnsetups/rnpsmenu/guides/players.md#operators) with the Flags right. Only the flags the region allows and the player may edit are applied (locked flags and flags of the anti-trap lock with visitors inside are skipped); the message says how many were skipped.

* **Copy from another region** copies the flags of one of your regions.
* **Save as template** (players with `rnpsmenu.admin`) saves the flags of the region as a new template.

The names and descriptions players see for templates are under `presets` in the language files (for example `presets.private.name: 'Private'`).
