# Region Selection

For claiming regions, players needs select region area first. For this purpose, there is Region Selection Mode.

Unlike other region claim plugins, our region selection has these advantages:
- [x] A simple **one-shot command** under the module's command namespace - easy for players to find and remember.
- [x] **Pause Mode.** Easily pause selection mode with a single key if you need to break, place, or interact with something.
- [x] **No "janky" tools** required (like a wooden axe or golden shovel) - just toggle the selection mode and click your positions!
- [x] It is **brighter** and stands out more than the particle effects from other plugins.
- [x] Purely **client-side visuals** with no impact on the server.

## :icon-phs-toolbox: Prerequisites

To see selection visuals, you need one of the following plugins:
- [PacketEvents](https://spigotmc.org/resources/80279/)
- [ProtocolLib](https://spigotmc.org/resources/1997/)

## :icon-phs-hand-pointing: Usage

To toggle Selection Mode, use the `/region wand` command.

To pause or resume selection, press the `F` key (or whatever key is bound to the "Swap Hands" action in your client).

## :icon-phs-gear: Core Configuration

You can find the selection settings file at `/config/regions/selection.yml`.

Right now, there are not many settings for the selection mode itself. It mostly contains UI settings for now (see below).

```yaml selection.yml
Settings:
  UI:
    # Whether the UI feature is enabled for Selection Mode.
    # [Server restart required]
    Enabled: true
```

## :icon-phs-gear: UI Configuration

You can find the selection UI settings file at `/config/regions/selection.ui.yml`.

In this file you can toggle certain UI components and adjust the refresh rate of them.

```yaml selection.ui.yml
General:
  # Sets refresh rate (in game ticks) for the Selection UI components.
  # [Asynchronous]
  Component-Refresh-Rate: 10
Components:
  # Enables the BossBar UI component for Selection Mode.
  BossBar: true
  # Enables the Highlightning UI component for Selection Mode.
  Highlight: true
```

## :icon-phs-gear: UI Boss Bar Configuration

You can find the selection UI BossBar settings file at `/config/regions/selection.ui.bossbar.yml`.

In this file, you can customize the boss bar shown during Selection Mode. It displays info like selected blocks, your blocks limit quota, etc.

```yaml selection.ui.bossbar.yml
Bar:
  # Sets title for the Selection BossBar UI element.
  # Placeholders:
  # - %current% - Number of currently selected blocks.
  # - %max% - Players' region blocks limit.
  # - %state% - Select pause state (ON/OFF).
  Title: <white>Region Selection</white> <gray>[<white>%current%</white>/<yellow>%max%</yellow> Blocks]</gray> <dark_gray>●</dark_gray> %state%
  # Sets color for the Selection BossBar UI element.
  # Available values: [PINK, BLUE, RED, GREEN, YELLOW, PURPLE, WHITE]
  Color: BLUE
  # Sets overlay for the Selection BossBar UI element.
  # Available values: [PROGRESS, NOTCHED_6, NOTCHED_10, NOTCHED_12, NOTCHED_20]
  Overlay: PROGRESS
```

## :icon-phs-gear: UI Highlight Configuration

You can find the selection UI Highlight settings file at `/config/regions/selection.ui.highlight.yml`.

In this file, you can customize the highlighting visuals and change their render distance.

```yaml selection.ui.highlight.yml
Highlight:
  # Sets highlight color in ARGB format.
  Color: 255,0,255,255
  # Sets the render distance (in blocks) of selection borders.
  # Works via client-side packets. High values may lead to client framerate degradation.
  # [Default is 32]
  Render-Distance: 32
  # Block to display on the corners of the selection border highlight.
  # [Default is minecraft:stone_brick_wall]
  Corner-Type: minecraft:stone_brick_wall
  # Block connecting the corners of the selection border highlight.
  # [Default is minecraft:iron_chain]
  Connection-Type: minecraft:iron_chain
```

!!! Missing the config file?
Make sure you have installed all the [prerequisites](#prerequisites).
!!!
