> 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-wen-dang/cai-dan-shi-li/server-menu.md).

# 服务器导航菜单示例

本例创建主导航 `server-hub` 和信息页 `server-info`，演示菜单跳转、返回、关闭，以及显示元素与点击区域的对应关系。适用于 Paper、Folia、Leaf 和 Spigot，无需其他插件或图片资源。

## 创建两个文件

Paper 系服务端放入 `plugins/ArcMenu/menus/`；Spigot 放入 `plugins/ArcMenu/spigot/menus/`。保留现有唯一主菜单，本例不修改 `main-menu`。

### `server-hub.yml`

```yaml
schema-version: 1
id: server-hub
permission: arcmenu.use
canvas:
  width: 320
  height: 180
  pixels-per-block: 42.7
  distance: 3
frontend:
  hub-background:
    type: rectangle
    width: 200
    height: 110
    color: '#182031'
  hub-title:
    type: text
    content: '&fServer menu'
    size: 5
    offset: {x: 0, y: 40, z: 1}
  information-button:
    type: rectangle
    width: 70
    height: 20
    color: '#365E91'
    offset: {x: -45, y: 0, z: 1}
  information-label:
    type: text
    content: '&fInformation'
    size: 3
    offset: {x: -45, y: 0, z: 2}
  help-button:
    type: rectangle
    width: 70
    height: 20
    color: '#365E91'
    offset: {x: 45, y: 0, z: 1}
  help-label:
    type: text
    content: '&fHelp'
    size: 3
    offset: {x: 45, y: 0, z: 2}
  close-label:
    type: text
    content: '&7Close'
    size: 3
    offset: {x: 0, y: -35, z: 1}
backend:
  information-area:
    x: -45
    y: 0
    width: 70
    height: 20
    actions:
      right: 'open: server-info'
  help-area:
    x: 45
    y: 0
    width: 70
    height: 20
    actions:
      right: 'tell: &eContact a server administrator for help.'
  close-area:
    x: 0
    y: -35
    width: 50
    height: 16
    actions:
      right: close
```

### `server-info.yml`

```yaml
schema-version: 1
id: server-info
permission: arcmenu.use
canvas:
  width: 320
  height: 180
  pixels-per-block: 42.7
  distance: 3
frontend:
  information-background:
    type: rectangle
    width: 200
    height: 110
    color: '#182031'
  information-title:
    type: text
    content: '&fServer information'
    size: 5
    offset: {x: 0, y: 40, z: 1}
  player-label:
    type: text
    content: '&7Player: &f%player_name%'
    size: 3
    offset: {x: 0, y: 10, z: 1}
  rules-label:
    type: text
    content: '&7Please follow the server rules.'
    size: 3
    offset: {x: 0, y: -10, z: 1}
  back-button:
    type: rectangle
    width: 70
    height: 18
    color: '#365E91'
    offset: {x: 0, y: -35, z: 1}
  back-label:
    type: text
    content: '&fBack'
    size: 3
    offset: {x: 0, y: -35, z: 2}
backend:
  back-area:
    x: 0
    y: -35
    width: 70
    height: 18
    actions:
      right: back
```

## 加载与操作

```
/arcmenu validate
/arcmenu reload
/arcmenu open server-hub
```

右键“Information”进入信息页，右键“Back”返回导航页。直接用命令打开信息页时没有上一菜单，“Back”会关闭当前菜单。右键“Help”发送帮助消息，右键“Close”关闭菜单。

示例中的英文菜单文字可在相应 `content` 与 `tell` 中改为服务器需要的语言。插件语言设置不会自动翻译这些内容。

## 调整与检查

修改按钮位置或尺寸时，同步调整显示元素与点击区域。新增页面时创建独立菜单，并将 `open` 目标改为该菜单的 `id`。

若要作为 Shift+F 主菜单，将现有主菜单的标记移除，再给 `server-hub` 添加 `main-menu: true`，确保全服仍只有一个主菜单。

示例结构与导航目标已检查，显示效果和实际点击需在游戏中验证。扩展声音、权限与菜单命令时参阅[动作与导航](/arcmenu-wen-dang/cai-dan-pei-zhi/menus/actions.md)。
