Skip to content

GUI 配置

委托 GUI 放在:

text
plugins/GTCommission/guis/commission/

悬赏 GUI 放在:

text
plugins/GTCommission/guis/bounty/

两个目录都支持子目录和多个 yml 文件。面板通过 gui: GUI_ID 选择委托界面;悬赏系统使用固定 ID 的 defaultpublishplayerrewarditem-selectdetailminemine-detail 界面。

悬赏 GUI ID用途
default悬赏大厅
publish选择可发布的悬赏模板
player选择玩家目标
reward选择奖励、币种、押金和悬赏份数
item-select选择物资征集需要的物品和数量
detail接取者查看悬赏需求和奖励
mine发布者查看自己发布的悬赏
mine-detail发布者查看接取玩家、结算状态并取消悬赏

矩阵写法

矩阵里的字符直接对应 items 下的同名节点,不需要额外写一层 layout

yaml
title: "&8[ &a{board_name} &8]"
size: 54
matrix:
  - "BBBBBBBBB"
  - "BTTTTTTTB"
  - "BTTTTTTTB"
  - "BTTTTTTTB"
  - "BTTTTTTTB"
  - "B<  X I>B"
items:
  B:
    material: BLACK_STAINED_GLASS_PANE
    legacy-material: STAINED_GLASS_PANE
    data: 15
    name: " "
  I:
    material: BOOK
    name: "&b[ &3委托信息 &b]"
    lore:
      - "&7面板: &f{board_name}"
      - "&7任务池: &f{pool_name}"
      - "&7完成: &f{complete}/{total}"
      - "&7下次刷新: &f{reset_time}"

每行必须是 9 个字符。size: 54 代表 6 行,矩阵也要写 6 行。空格表示空槽位。

动态位置

动态位置通过 type 指定用途。相同字符在矩阵中出现多次时,插件会自动分页填充内容。

委托 GUI 常用类型:

type用途
task任务列表位置
previous上一页
next下一页
back关闭或返回

悬赏 GUI 常用类型:

type用途
bounty悬赏大厅列表
owned-bounty“我的悬赏”列表
publish可发布的悬赏模板
player在线玩家目标
reward奖励档位
custom-reward输入自定义奖励数量
inventory发布物资悬赏时显示玩家背包
item-confirm确认已选物品
requirement悬赏需求物品列表
requirement-submit提交全部需求物品
setting-multiple是否允许多人接取
setting-shares悬赏份数
setting-deposit押金档位
setting-economy经济类型
tip追加小费
my-bounties打开“我的悬赏”
cancel-bounty取消当前开放悬赏,点击后会再次确认

任务状态样式

任务位置可以分别配置未接取、进行中、可领取和已领取样式:

yaml
T:
  type: task
  states:
    unaccepted:
      material: "{task_icon}"
      name: "&7[未接取] {task_name}"
      lore:
        - "{task_description}"
        - "&e点击接取任务"
    active:
      material: "{task_icon}"
      name: "{task_name}"
      lore:
        - "{task_description}"
        - ""
        - "&7进度: &f{task_progress}/{task_required}"
        - "{task_action}"
    completed:
      material: "{task_icon}"
      name: "&e[可领取] {task_name}"
      lore:
        - "{task_description}"
        - "&e点击领取奖励"
    claimed:
      material: "{task_icon}"
      name: "&a[已领取] {task_name}"
      lore:
        - "&8本周期奖励已领取"

悬赏奖励位置支持 moneyitem 两种状态,对应经济奖励和主手物品奖励。

物品字段

yaml
I:
  material: BOOK
  legacy-material: BOOK
  data: 0
  amount: 1
  custom-model-data: 10001
  glow: false
  name: "&b信息"
  lore:
    - "&7玩家: &f{player}"
  permission: ""
  conditions: []
字段说明
material当前版本使用的原版材质,支持内部变量
legacy-material1.12 等旧版本找不到新材质时使用的材质
data旧版本物品子 ID
item物品库 ID,填写后优先从物品库创建
amount显示数量,范围 1 - 64
custom-model-data自定义模型数据,旧版本会自动忽略
glow是否显示附魔光效
namelore名称与说明,支持 PAPI 和内部变量
permission玩家没有该权限时不显示
conditions条件不满足时不显示

物品库写法:

yaml
item: "mm:MenuIcon"

物品库 ID 的具体前缀以 GTCore 当前已接入的物品插件为准。

点击动作

yaml
I:
  material: NETHER_STAR
  name: "&e打开悬赏大厅"
  actions:
    left:
      - "[open-bounty]"
    right:
      - "message: &7请使用左键打开。"
    shift-left:
      - "[close]"

点击键可使用:

text
left
right
middle
shift-left
shift-right
any

内置动作:

动作说明
[close]关闭 GUI
[refresh]刷新当前 GUI
[next]下一页
[previous]上一页
[open-bounty]打开悬赏大厅
[open-my-bounties]打开“我的悬赏”
[publish-bounty]打开悬赏发布界面
[cancel-publish]放弃当前发布流程并提示已经取消
[open-commission] 面板ID打开指定委托面板

其他内容按奖励动作执行,例如:

yaml
actions:
  left:
    - "console: warp {player} guild"
    - "message: &a正在前往公会。"

GUI 继承

只想修改标题或少量按钮时,可以继承已有 GUI:

yaml
extends: default
title: "&8[ &6公会周常委托 &8]"
items:
  I:
    material: CLOCK
    name: "&6周常委托"

子 GUI 没有填写的矩阵和物品会沿用父 GUI。extends 填同一 GUI 目录中的 ID,不能循环继承。

委托内部变量

text
{player} {uuid}
{board_id} {board_name}
{pool} {pool_name}
{total} {accepted} {complete} {claimed} {streak}
{reset_seconds} {reset_time}
{page} {pages}
{task_id} {task_name} {task_icon}
{task_description} {task_type} {task_targets}
{task_progress} {task_required} {task_state} {task_state_id} {task_action}
{task_auto_accept} {task_accepted}

悬赏内部变量

text
{bounty_id} {bounty_name} {bounty_icon}
{bounty_description} {bounty_type} {bounty_target}
{bounty_progress} {bounty_required} {bounty_state}
{bounty_reward} {bounty_expires}
{publisher} {hunters} {max_hunters}
{shares} {winner_count} {deposit} {tip}
{economy} {economy_name} {currency}
{bounty_published_open}
{requirement_name} {requirement_icon}
{requirement_progress} {requirement_required}
{selected_count} {selected_items}
{multiple} {multiple_mode}
{custom_reward_enabled} {custom_reward_min}
{custom_reward_max} {custom_reward_step}
{hunter_list} {current_hunter_list} {winner_list}
{cancel_fee} {cancel_fee_currency}
{cancel_fee_status} {cancel_fee_system_percent}
{cancel_fee_share} {cancel_free_time}

{task_type}{bounty_type}{escrow}{refresh_mode} 和状态变量显示 messages.yml 中配置的中文名称。对应的 {task_type_id}{bounty_type_id}{escrow_id}{refresh_mode_id}{bounty_state_id} 保留原始内部 ID。

{task_targets}{bounty_target} 显示目标中文名,{task_targets_id}{bounty_target_id} 返回匹配进度使用的原始 ID。目标名称在 messages.yml -> display.targets 中配置。

多行变量如 {task_description}{bounty_description}{selected_items} 会在 Lore 中自动展开。所有名称、Lore、标题、条件和动作都会继续处理 PAPI 变量。

修改后检查

  1. 确认矩阵行数和 size 一致。
  2. 确认每行恰好 9 个字符。
  3. 确认矩阵使用的每个非空字符都在 items 中存在。
  4. 1.12 使用新材质时同时填写 legacy-material 和必要的 data
  5. 执行 /gtcom reload,再重新打开 GUI。