Dialogs+
使用 Minecraft 原生的对话框系统构建完全自定义的游戏内菜单。无需资源包,无需客户端模组,你的玩家无需安装任何额外内容。
Dialogs+ 允许你通过简单的 YAML 配置文件创建交互式菜单、子菜单和表单,或者使用内置编辑器在游戏内直接构建。它基于 Minecraft 1.21.6 引入的原生对话框 UI(Paper API 自 1.21.7 起支持)。每位加入服务器的玩家都能看到这些菜单,无需安装任何额外插件,因为这一切都是建立在 Paper 自带功能之上的。
特性
- YAML 菜单:每个菜单一个文件,从
plugins/DialogsPlus/menus/ 加载
- 游戏内编辑器 (
/dialogsplus edit):在不接触 YAML 的情况下创建、编辑、预览和删除菜单、组件和操作
- 多种输入类型:文本字段、开关、数字滑块和单选选项
- 按钮链式操作:按顺序执行命令(以玩家或控制台身份)、发送消息、关闭对话框或跳转到子菜单
{input} 替换:将玩家输入的文本直接传入命令中,例如一个运行 /tpa {target} 的传送请求按钮
- 权限控制的按钮和菜单:隐藏没有相应权限的玩家可见的特定按钮,或锁定整个菜单
- 物品预览图标:在按钮旁显示物品(或特定玩家的头颅,或点击者自己的头颅)
- 即时链接和命令建议按钮:
OPEN_URL 和 SUGGEST_COMMAND 操作在单独使用时会原生触发
- PlaceholderAPI 支持:在标题、正文文本、按钮标签和工具提示中使用占位符(可选)
- 导入和导出:作为
.yml 文件分享单个菜单
- 自定义命令:在
config.yml 中将任意命令(例如 /menu)直接映射到菜单
- 热重载:使用
/dialogsplus reload 更新菜单,无需重启服务器
要求
- Paper 1.21.11+(或其衍生版本)
- Java 25
- (可选)PlaceholderAPI,如果你想在标题、正文文本和工具提示中使用占位符
为什么支持的版本这么少? 如果发现重大 bug,我可能会删除包含该 bug 的旧版本,以防止人们下载并遇到已修复的问题。
快速开始
- 将 jar 文件放入
plugins/ 文件夹并启动服务器。
- 运行
/dialogsplus edit 并点击 + New menu,或将你自己的 .yml 文件添加到 plugins/DialogsPlus/menus/。
- 使用
/dialogs <menu-id> 打开你的菜单。
示例菜单 (plugins/DialogsPlus/menus/main.yml):
id: main
title: "Main Menu"
body:
- "Welcome! Choose an option below."
components:
- id: homes
label: "Homes"
icon: GRASS_BLOCK
type: BUTTON
actions:
- type: CLOSE
- type: RUN_COMMAND
command: "homes"
命令
| 命令 |
描述 |
/dialogs <menu-id> |
为运行该命令的玩家打开指定菜单 |
/dialogsplus reload |
从磁盘重新加载所有菜单文件 |
/dialogsplus export <menu-id> |
将菜单文件复制到 plugins/DialogsPlus/exports/ |
/dialogsplus import <file> |
将文件从 plugins/DialogsPlus/imports/ 复制到 menus/ 并重载 |
/dialogsplus edit |
打开游戏内菜单编辑器(仅限玩家) |
/dialogsplus edit <menu-id> |
直接在某个菜单上打开编辑器 |
此外还包括你在 config.yml 中映射的任何自定义命令(参见 命令映射)。
权限
| 权限 |
描述 |
dialogsplus.edit |
使用游戏内编辑器(默认:op) |
重载、导出和导入使用 config.yml 中设置的重载权限集。
警告: 请将 dialogsplus.edit 视为控制台访问权限。拥有此权限的人可以创建 RUN_COMMAND_AS_CONSOLE 操作。仅授予受信任的管理员。
首次运行
在首次启动时,Dialogs+ 会创建以下目录结构:
plugins/DialogsPlus/
menus/ <- 在此放置你的菜单 .yml 文件
exports/ <- 导出的菜单文件将存放于此
imports/ <- 在导入之前将菜单文件放在此处
backups/ <- 由编辑器创建
config.yml <- 插件设置、命令映射、消息
README.txt <- 说明文档,首次运行时自动复制至此
menus 文件夹初始为空。使用 /dialogsplus edit 在游戏内创建第一个菜单,或手动添加菜单文件并运行 /dialogsplus reload。
注意: README.txt 仅在首次运行时复制。更新插件后,删除 plugins/DialogsPlus/README.txt 并重启以获得最新版本。
游戏内编辑器
运行 /dialogsplus edit 打开编辑器。它与你使用的菜单基于相同的原生对话框系统构建,因此不需要额外的模组、端口或 Web 服务器。
在菜单列表中你可以:
- 创建新菜单(“+ New menu”:ID 和标题;初始包含一个关闭按钮,因为对话框至少需要一个按钮)
- 打开任意菜单进行编辑
- 删除菜单(需确认)
在菜单内部你可以编辑:
- 设置: 标题、外部标题、权限、是否可通过 Esc 关闭
- 正文文本: 每行一条消息
- 组件: 添加、编辑、排序(上移 / 下移)和删除,适用于所有 5 种类型(
BUTTON, TEXT_INPUT, BOOLEAN_INPUT, NUMBER_INPUT, SINGLE_OPTION_INPUT)
- 按钮上的操作: 添加、编辑、排序和删除,适用于所有 7 种操作类型
- 预览: 打开真实菜单。其按钮确实会执行它们的操作!
每项更改都会立即保存到菜单的 YAML 文件中。没有单独的“应用”步骤,也无需运行 /dialogsplus reload。
备份及注意事项:
- 保存操作会重写整个 YAML 文件,因此你文件中的注释将会丢失。编辑器首次保存菜单时,原始文件会被复制到
plugins/DialogsPlus/backups/<id>.original.yml
- 删除一个菜单会在
backups/<id>.deleted.yml 中保留一份副本
- 不要在玩家正在编辑的过程中运行
/dialogsplus reload。重载会替换已加载的菜单,而处于打开状态的编辑器随后会保存过时数据。
- 尚不支持在游戏内编辑:重命名菜单 ID、更改组件类型(请删除后重新添加),以及
config.yml 中的 commands: 部分。
命令映射
你可以将任意自定义命令直接映射到菜单,这样玩家就无需知晓菜单的 ID。在 plugins/DialogsPlus/config.yml 中设置此项:
commands:
main: "/menu"
tpa-menu: "/teleport"
输入 /menu 后的行为与 /dialogs main 完全相同。
重要提示: 对 commands 部分的修改需要完整重启服务器才能生效,这与菜单 .yml 文件不同,后者可以通过 /dialogsplus reload 实时生效。
配置参考
菜单文件
plugins/DialogsPlus/menus/ 目录下的每个 .yml 文件都会在启动或执行 /dialogsplus reload 时作为一个菜单被加载。菜单的 id 字段是你引用它的方式(例如在 /dialogs <id> 或 OPEN_MENU 动作中)。通过编辑器创建的菜单会保存为 menus/<id>.yml。
菜单级字段
id: main # 必填。唯一 ID,用于 /dialogs <id>
title: "Main Menu" # 必填。显示在对话框顶部
external-title: "Server Menu" # 可选。如果此菜单是从其他地方作为按钮/链接打开时使用的标题
can-close-with-escape: true # 可选,默认值为 true
permission: "dialogsplus.staff" # 可选。除非玩家拥有此权限,否则整个菜单将被锁定
body: # 可选。纯文本行
- "Welcome!"
- "Choose an option below."
components: # 必填。见下文“组件”
- ...
一个菜单至少需要一个 BUTTON 组件,否则无法打开。
组件
components 中的每一项要么是 BUTTON,要么是输入框。
BUTTON
- id: homes # 必填,在此菜单内唯一
label: "Homes" # 必填。按钮上显示的文本
tooltip: "View your homes" # 可选。悬停时显示的文本
icon: GRASS_BLOCK # 可选。见下方“图标”
permission: "homes.use" # 可选。如果玩家缺乏此权限,按钮将被隐藏
type: BUTTON
actions: # 必填。按顺序执行,见下方“动作”
- ...
TEXT_INPUT
- id: target
label: "Player Name"
type: TEXT_INPUT
BOOLEAN_INPUT
- id: confirm
label: "I agree"
type: BOOLEAN_INPUT
NUMBER_INPUT
- id: amount
label: "Amount"
type: NUMBER_INPUT
min: 0
max: 100
step: 1 # 可选
initial: 0 # 可选
SINGLE_OPTION_INPUT
- id: choice
label: "Pick one"
type: SINGLE_OPTION_INPUT
options:
- "Option A"
- "Option B"
注意: 组件 ID 可以使用字母、数字、- 和 _(最多 64 个字符)。
图标
icon: GRASS_BLOCK # 任何原版 Material 名称
icon: player_head:Notch # 指定名称的玩家头颅
icon: "player_head:{self}" # 点击者自己的头颅(动态)
权限(菜单)
支持两个级别的权限门控:
- 按菜单: 在菜单
.yml 文件的顶层设置 permission: 以锁定整个菜单。没有该权限的玩家将收到来自 config.yml 的 no-permission 消息,而不是打开对话框。
- 按按钮: 在
BUTTON 组件上设置 permission: 以仅对缺乏该权限的玩家隐藏该按钮。菜单的其他部分仍正常打开。
PlaceholderAPI 支持
如果安装了 PlaceholderAPI,占位符将在以下位置被替换:
- 菜单标题和外部标题 (
external-title)
- 正文文本行
- 按钮标签
- 按钮工具提示
title: "Welcome, %player_name%"
body:
- "Your balance: %vault_eco_balance%"
如果没有安装 PlaceholderAPI,这些字段将作为纯文本显示,占位符语法保持不变(不会出错,只是不会解析)。
动作
每个按钮的 actions 列表在点击按钮时按顺序执行。
| 动作 |
作用 |
RUN_COMMAND |
以点击者的身份运行命令 |
RUN_COMMAND_AS_CONSOLE |
以控制台身份运行命令 |
CLOSE |
关闭当前对话框 |
SEND_MESSAGE |
发送一条普通聊天消息 |
OPEN_MENU |
通过 ID 打开另一个菜单(子菜单导航) |
OPEN_URL |
打开链接 |
SUGGEST_COMMAND |
预填玩家的聊天栏为一条命令 |
- type: RUN_COMMAND
command: "homes" # 不要带前导斜杠
- type: RUN_COMMAND_AS_CONSOLE
command: "give {player} diamond 1"
- type: CLOSE
- type: SEND_MESSAGE
message: "Request sent!"
- type: OPEN_MENU
target: tpa-menu
- type: OPEN_URL
url: "https://example.com"
- type: SUGGEST_COMMAND
command: "msg SomePlayer "
注意: 如果 OPEN_URL 和 SUGGEST_COMMAND 是按钮上的唯一动作,它们会立即触发。如果与其他动作链式组合,玩家则会收到一条可点击的聊天消息。
在编辑器中,RUN_COMMAND / RUN_COMMAND_AS_CONSOLE 的前导 / 会被自动移除,且 OPEN_URL 必须以 http:// 或 https:// 开头。
{id} 替换
RUN_COMMAND / RUN_COMMAND_AS_CONSOLE / SEND_MESSAGE / OPEN_URL / SUGGEST_COMMAND 的值可以使用 {that-component-id} 引用同一菜单中另一组件的输入值:
components:
- id: target
label: "Player Name"
type: TEXT_INPUT
- id: send
label: "Send Request"
type: BUTTON
actions:
- type: CLOSE
- type: RUN_COMMAND
command: "tpa {target}"
导入和导出
导出菜单以与他人共享或进行备份:
/dialogsplus export <menu-id>
-> 将 plugins/DialogsPlus/menus/<menu-id>.yml 复制到
plugins/DialogsPlus/exports/<menu-id>.yml
导入他人分享给你的菜单:
- 将其
.yml 文件放入 plugins/DialogsPlus/imports/
- 运行
/dialogsplus import <filename.yml>
- 它会被复制到
menus/ 中,并且菜单会自动重新加载
完整工作示例
plugins/DialogsPlus/menus/main.yml:
id: main
title: "Main Menu"
body:
- "Welcome! Choose an option below."
components:
- id: homes
label: "Homes"
icon: GRASS_BLOCK
tooltip: "View your homes"
type: BUTTON
actions:
- type: CLOSE
- type: RUN_COMMAND
command: "homes"
- id: tpa
label: "Teleport Request"
type: BUTTON
actions:
- type: OPEN_MENU
target: tpa-menu
plugins/DialogsPlus/menus/tpa-menu.yml:
id: tpa-menu
title: "Teleport Request"
components:
- id: target
label: "Player Name"
type: TEXT_INPUT
- id: send
label: "Send Request"
type: BUTTON
actions:
- type: CLOSE
- type: RUN_COMMAND
command: "tpa {target}"
- id: back
label: "Back"
type: BUTTON
actions:
- type: OPEN_MENU
target: main
路线图
Dialogs+
Build fully custom in-game menus using Minecraft's native Dialog system. No resource packs, no client mods, zero installs required for your players.
Dialogs+ lets you create interactive menus, sub-menus, and forms entirely through simple YAML config files, or build them in-game with the built-in editor. It is powered by the vanilla Dialog UI introduced in Minecraft 1.21.6 (Paper API since 1.21.7). Every player who joins your server sees these menus with nothing extra installed, because it's all built on top of what Paper already ships.
Features
- YAML menus: one file per menu, loaded from
plugins/DialogsPlus/menus/
- In-game editor (
/dialogsplus edit): create, edit, preview and delete menus, components and actions without touching YAML
- Multiple input types: text fields, toggles, number sliders, and single-choice options
- Chainable actions per button: run a command (as the player or as console), send a message, close the dialog, or jump to a sub-menu, all in sequence
{input} substitution: feed a player's typed input straight into a command, e.g. a teleport-request button that runs /tpa {target}
- Permission-gated buttons and menus: hide specific buttons from players who don't have the right permission, or lock a whole menu
- Item preview icons: show an item (or a specific player's head, or the clicking player's own head) alongside a button
- Instant link and command-suggestion buttons:
OPEN_URL and SUGGEST_COMMAND actions fire natively when used on their own
- PlaceholderAPI support: use placeholders in titles, body text, button labels and tooltips (optional)
- Import and export: share individual menus as
.yml files
- Custom commands: map any command (e.g.
/menu) straight to a menu in config.yml
- Live reload: update your menus with
/dialogsplus reload, no restart needed
Requirements
- Paper 1.21.11+ (or a Paper fork built on it)
- Java 25
- (Optional) PlaceholderAPI, if you want placeholders in titles, body text and tooltips
Why so few versions? If I find a big bug, I will probably delete the old version containing it, so people can't download it and run into problems that have already been fixed.
Quick start
- Drop the jar into your
plugins/ folder and start the server.
- Run
/dialogsplus edit and click + New menu, or add your own .yml file to plugins/DialogsPlus/menus/.
- Open your menu with
/dialogs <menu-id>.
Example menu (plugins/DialogsPlus/menus/main.yml):
id: main
title: "Main Menu"
body:
- "Welcome! Choose an option below."
components:
- id: homes
label: "Homes"
icon: GRASS_BLOCK
type: BUTTON
actions:
- type: CLOSE
- type: RUN_COMMAND
command: "homes"
Commands
| Command |
Description |
/dialogs <menu-id> |
Opens the given menu for the player running it |
/dialogsplus reload |
Reloads all menu files from disk |
/dialogsplus export <menu-id> |
Copies a menu file into plugins/DialogsPlus/exports/ |
/dialogsplus import <file> |
Copies a file from plugins/DialogsPlus/imports/ into menus/ and reloads |
/dialogsplus edit |
Opens the in-game menu editor (players only) |
/dialogsplus edit <menu-id> |
Opens the editor directly on one menu |
Plus any custom commands you've mapped in config.yml (see Command mapping).
Permissions
| Permission |
Description |
dialogsplus.edit |
Use the in-game editor (default: op) |
Reload, export and import use the reload permission set in config.yml.
Warning: treat dialogsplus.edit like console access. Anyone who has it can create RUN_COMMAND_AS_CONSOLE actions. Give it to trusted admins only.
First run
On first startup, Dialogs+ creates:
plugins/DialogsPlus/
menus/ <- put your menu .yml files here
exports/ <- menus you've exported land here
imports/ <- drop a menu file here before importing it
backups/ <- created by the editor
config.yml <- plugin settings, command mapping, messages
README.txt <- the readme, auto-copied here once
The menus folder starts empty. Create your first menu in-game with /dialogsplus edit, or add menu files by hand and run /dialogsplus reload.
Note: README.txt is only copied on first run. After updating the plugin, delete plugins/DialogsPlus/README.txt and restart to get the newest copy.
In-game editor
Run /dialogsplus edit to open the editor. It is built from the same native Dialog system as your menus, so it needs no extra mods, ports or web server.
From the menu list you can:
- Create a new menu ("+ New menu": an ID and a title; it starts with one Close button, because a dialog needs at least one button)
- Open any menu to edit it
- Delete a menu (with confirmation)
Inside a menu you can edit:
- Settings: title, external title, permission, can-close-with-escape
- Body text: one line per message
- Components: add, edit, reorder (Move up / Move down) and delete, for all 5 types (
BUTTON, TEXT_INPUT, BOOLEAN_INPUT, NUMBER_INPUT, SINGLE_OPTION_INPUT)
- Actions on buttons: add, edit, reorder and delete, for all 7 action types
- Preview: opens the real menu. Its buttons really run their actions!
Every change is saved to the menu's YAML file immediately. There is no separate "apply" step and you don't need to run /dialogsplus reload.
Backups and things to know:
- Saving rewrites the whole YAML file, so comments in your file are lost. The first time the editor saves a menu, your original file is copied to
plugins/DialogsPlus/backups/<id>.original.yml
- Deleting a menu keeps a copy in
backups/<id>.deleted.yml
- Don't run
/dialogsplus reload while someone is in the middle of editing. Reload replaces the loaded menus, and the open editor would then save stale data.
- Not editable in-game yet: renaming a menu ID, changing a component's type (delete and re-add it instead), and the
commands: section of config.yml.
Command mapping
You can map any custom command straight to a menu, so players don't need to know a menu's id at all. Set this in plugins/DialogsPlus/config.yml:
commands:
main: "/menu"
tpa-menu: "/teleport"
Typing /menu then behaves exactly like /dialogs main.
Important: changes to the commands section require a full server restart to take effect, unlike menu .yml files, which /dialogsplus reload picks up live.
Configuration reference
Menu files
Each .yml file in plugins/DialogsPlus/menus/ is loaded as one menu on startup or on /dialogsplus reload. The menu's id field is what you reference it by (e.g. in /dialogs <id> or an OPEN_MENU action). Menus created in the editor are saved as menus/<id>.yml.
Menu-level fields
id: main # required. Unique id, used in /dialogs <id>
title: "Main Menu" # required. Shown at the top of the dialog
external-title: "Server Menu" # optional. Used if this menu is opened as a
# button/link from elsewhere
can-close-with-escape: true # optional, default true
permission: "dialogsplus.staff" # optional. Whole menu is locked unless
# the player has this permission
body: # optional. Lines of plain text
- "Welcome!"
- "Choose an option below."
components: # required. See Components below
- ...
A menu needs at least one BUTTON component, otherwise it can't be opened.
Components
Each entry in components is either a BUTTON or an input field.
BUTTON
- id: homes # required, unique within this menu
label: "Homes" # required. Text shown on the button
tooltip: "View your homes" # optional. Hover text
icon: GRASS_BLOCK # optional. See Icons below
permission: "homes.use" # optional. Button is hidden if the player
# lacks this permission
type: BUTTON
actions: # required. Run in order, see Actions below
- ...
TEXT_INPUT
- id: target
label: "Player Name"
type: TEXT_INPUT
BOOLEAN_INPUT
- id: confirm
label: "I agree"
type: BOOLEAN_INPUT
NUMBER_INPUT
- id: amount
label: "Amount"
type: NUMBER_INPUT
min: 0
max: 100
step: 1 # optional
initial: 0 # optional
SINGLE_OPTION_INPUT
- id: choice
label: "Pick one"
type: SINGLE_OPTION_INPUT
options:
- "Option A"
- "Option B"
Note: component ids may use letters, numbers, - and _ (max 64 characters).
Icons
icon: GRASS_BLOCK # any vanilla Material name
icon: player_head:Notch # a specific player's head by name
icon: "player_head:{self}" # the CLICKING player's own head (dynamic)
Permissions (menus)
Two levels of permission gating are supported:
- Per-menu: set
permission: at the top level of a menu .yml file to lock the whole menu. A player without it gets the no-permission message from config.yml instead of the dialog opening.
- Per-button: set
permission: on a BUTTON component to hide just that button from players who lack it. The rest of the menu still opens normally.
PlaceholderAPI support
If PlaceholderAPI is installed, placeholders are replaced in:
- Menu title and external-title
- Body text lines
- Button labels
- Button tooltips
title: "Welcome, %player_name%"
body:
- "Your balance: %vault_eco_balance%"
If PlaceholderAPI is not installed, these fields are shown as plain text with the placeholder syntax left in (nothing breaks, it just won't resolve).
Actions
Each button's actions list runs in order when the button is clicked.
| Action |
What it does |
RUN_COMMAND |
Runs a command as the clicking player |
RUN_COMMAND_AS_CONSOLE |
Runs a command as console |
CLOSE |
Closes the current dialog |
SEND_MESSAGE |
Sends a plain chat message |
OPEN_MENU |
Opens another menu by id (sub-menu navigation) |
OPEN_URL |
Opens a link |
SUGGEST_COMMAND |
Pre-fills the player's chat bar with a command |
- type: RUN_COMMAND
command: "homes" # no leading slash
- type: RUN_COMMAND_AS_CONSOLE
command: "give {player} diamond 1"
- type: CLOSE
- type: SEND_MESSAGE
message: "Request sent!"
- type: OPEN_MENU
target: tpa-menu
- type: OPEN_URL
url: "https://example.com"
- type: SUGGEST_COMMAND
command: "msg SomePlayer "
Note: OPEN_URL and SUGGEST_COMMAND only fire instantly if they are the only action on that button. If chained with other actions, the player instead gets a clickable chat message.
In the editor, a leading / on RUN_COMMAND / RUN_COMMAND_AS_CONSOLE is removed automatically, and OPEN_URL must start with http:// or https://.
{id} substitution
A RUN_COMMAND / RUN_COMMAND_AS_CONSOLE / SEND_MESSAGE / OPEN_URL / SUGGEST_COMMAND value can reference another component's input value in the same menu using {that-component-id}:
components:
- id: target
label: "Player Name"
type: TEXT_INPUT
- id: send
label: "Send Request"
type: BUTTON
actions:
- type: CLOSE
- type: RUN_COMMAND
command: "tpa {target}"
Import and export
Export a menu to share it with someone else or back it up:
/dialogsplus export <menu-id>
-> copies plugins/DialogsPlus/menus/<menu-id>.yml into
plugins/DialogsPlus/exports/<menu-id>.yml
Import a menu someone shared with you:
- Place their
.yml file into plugins/DialogsPlus/imports/
- Run
/dialogsplus import <filename.yml>
- It is copied into
menus/ and the menus reload automatically
Full working example
plugins/DialogsPlus/menus/main.yml:
id: main
title: "Main Menu"
body:
- "Welcome! Choose an option below."
components:
- id: homes
label: "Homes"
icon: GRASS_BLOCK
tooltip: "View your homes"
type: BUTTON
actions:
- type: CLOSE
- type: RUN_COMMAND
command: "homes"
- id: tpa
label: "Teleport Request"
type: BUTTON
actions:
- type: OPEN_MENU
target: tpa-menu
plugins/DialogsPlus/menus/tpa-menu.yml:
id: tpa-menu
title: "Teleport Request"
components:
- id: target
label: "Player Name"
type: TEXT_INPUT
- id: send
label: "Send Request"
type: BUTTON
actions:
- type: CLOSE
- type: RUN_COMMAND
command: "tpa {target}"
- id: back
label: "Back"
type: BUTTON
actions:
- type: OPEN_MENU
target: main
Roadmap
- Currently no ideas for the roadmap, but more stuff is coming soon
评论 0
登录后参与评分
还没有评论,来抢沙发吧