> For the complete documentation index, see [llms.txt](https://simple.superiormc.cn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://simple.superiormc.cn/arcmenu-wiki/menu-configuration/menus/backend.md).

# Backend regions and click events

`backend` defines hit regions, tooltips and click actions. Visible buttons belong to `frontend` and require separately configured regions; matching names do not link them automatically.

This page covers region properties, click types under `actions`, and region conditions with denial actions. See [Actions and navigation](/arcmenu-wiki/menu-configuration/menus/actions.md) for action syntax and [Conditions](/arcmenu-wiki/menu-configuration/menus/conditions.md) for expressions and conditional branches.

## Region structure

```yaml
backend:
  greeting-area:
    x: 0
    y: -20
    width: 60
    height: 18
    actions:
      right:
        - 'tell: &aHello!'
      shift-right: close
```

The hierarchy is **`backend` → region name (`greeting-area`) → region properties → `actions` → click type → actions**.

This example creates a region centered at `(0, -20)`, with width `60` and height `18`. Right-clicking sends a message; Shift+right-click closes the menu. Merge the fragment into the existing `backend` and configure matching visible content.

Region names must be unique across the entire menu, including frontend elements and groups.

## Region properties

These properties belong under the region name, at the same level as `actions`.

| Property          | Purpose                                                                 | Default                    |
| ----------------- | ----------------------------------------------------------------------- | -------------------------- |
| `x`, `y`          | Region center coordinates.                                              | `0` each.                  |
| `width`, `height` | Required dimensions, greater than `0`.                                  | None.                      |
| `priority`        | Integer selection priority for overlapping regions.                     | `0`.                       |
| `tooltip`         | Text shown when pointing at the region, as a string or list of strings. | No tooltip.                |
| `update`          | Periodic tooltip refresh interval in game ticks.                        | `-1`, no periodic refresh. |
| `actions`         | Actions organized by click type.                                        | None.                      |
| `condition`       | Condition required when clicking the region.                            | No restriction.            |
| `deny`            | Actions when the region condition fails.                                | None.                      |

### Position and dimensions

Regions use canvas coordinates: positive `x` moves right and positive `y` moves up. Dimensions extend in both directions from the center.

The example above spans `-30` to `30` horizontally and `-29` to `-11` vertically. See [Canvas, coordinates and screen placement](/arcmenu-wiki/menu-configuration/menus/canvas.md) for directions and units.

Regions do not support `offset`, `rotation`, `scale`, `z` or `visible`. Update the region when moving or resizing its visible button. Hiding an element does not disable its region.

### Overlap priority: `priority`

When regions overlap, only one is selected. Higher `priority` wins; equal priorities select the region appearing earlier in the configuration.

If the selected region has no matching click action or its condition fails, lower regions are not tried. Large regions can therefore block smaller buttons; use layout or priorities to distinguish them.

This `priority` controls region selection, not the order of individual actions.

### Tooltip content: `tooltip` and `update`

See [Tooltips](/arcmenu-wiki/feature-configuration/tooltips.md) for complete appearance fields and image background settings.

Tooltips are displayed only on Paper, Folia, Leaf and compatible servers.

```yaml
backend:
  information-area:
    x: 0
    y: 0
    width: 80
    height: 24
    tooltip:
      - '&fServer information'
      - '&7Player: %player_name%'
    update: 20
```

`update` accepts `-1` or a positive integer, not `0`. It refreshes tooltip content without changing the region or refreshing frontend text.

`tooltip` defines content; size, background and other styles belong in `tooltip.yml`. Pointing at a region displays the tooltip without clicking, and a failed region `condition` does not automatically hide it.

Spigot does not display tooltips or periodically refresh their content.

## Click types: `actions`

Click types belong under a region's `actions`, not directly under the region name.

| Click type     | Trigger                      | Spigot                                |
| -------------- | ---------------------------- | ------------------------------------- |
| `all`          | Every supported click.       | Supported.                            |
| `left`         | Left-click without Shift.    | Supported.                            |
| `right`        | Right-click without Shift.   | Supported.                            |
| `middle`       | Middle-click without Shift.  | Unavailable.                          |
| `shift`        | Every supported Shift+click. | Shift+left and Shift+right supported. |
| `shift-left`   | Shift+left-click.            | Supported.                            |
| `shift-right`  | Shift+right-click.           | Supported.                            |
| `shift-middle` | Shift+middle-click.          | Unavailable.                          |

`right` does not include Shift+right-click, and `left` does not include Shift+left-click. Configure them separately or use `all` or `shift` where appropriate.

`middle` and `shift-middle` are available only in mouse mode on Paper-family servers. Touch mode does not provide middle-click input. See [Touch and mouse input](/arcmenu-wiki/feature-configuration/input-modes.md) for mode selection and controls.

### Single and multiple actions

A single action can be written directly. Multiple actions use a list and execute in list order.

```yaml
backend:
  notice-area:
    x: 0
    y: 0
    width: 80
    height: 24
    actions:
      all:
        - 'sound: UI_BUTTON_CLICK-1-1'
      right:
        - 'tell: &aFirst message.'
        - 'tell: &bSecond message.'
      shift-right: close
```

A regular right-click matches both `all` and `right`; Shift+right-click matches `all` and `shift-right`. Matching groups are processed in configuration order, rather than selecting only the most specific group.

Closing or switching menus, or ending execution, can prevent later actions from running. Place common feedback such as sounds in an earlier `all` group, followed by specific click actions.

## Region conditions and denial actions

`condition` and `deny` belong at the region-property level, not the click-type level. This region permits its right-click action only for players with the specified permission:

```yaml
backend:
  vip-area:
    x: 0
    y: 0
    width: 80
    height: 24
    condition: 'perm myserver.menu.vip'
    deny:
      - 'tell: &cYou do not have permission.'
    actions:
      right:
        - 'tell: &aAccess granted.'
```

Processing follows this order:

1. Select a region using pointer position and priority.
2. Check its `condition`.
3. On failure, run `deny` instead of `actions`.
4. On success, run actions matching the current click type.

Consequently, a failed condition can run the region's `deny` even when that click type has no configured action.

Region conditions do not automatically hide buttons or tooltips. To restrict only one click type, put the condition in that click's action configuration; see [Conditions](/arcmenu-wiki/menu-configuration/menus/conditions.md).

## Validation and loading

After editing, run `/arcmenu validate` and `/arcmenu reload`. Open the menu normally and check:

* Alignment between visible buttons and regions.
* Correct responses to ordinary clicks and Shift+clicks.
* Expected priority for overlapping regions.
* Correct denial feedback for players without permission.

On Paper-based servers, `/arcmenu preview <menu-id> backend` shows region positions without executing actions. On Spigot, test through a normally opened menu. See [Commands and permissions](/arcmenu-wiki/configuration-and-administration/commands-permissions.md).
