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 更新菜单,无需重启服务器
- 随处可用的颜色:在所有标题、标签、工具提示、正文行、选项和消息中支持
& 颜色代码、&#rrggbb 十六进制颜色以及完整的 MiniMessage(渐变、彩虹等)。你可以混合使用这两种样式。
- 游戏菜单按钮:可选择在主菜单(Esc 界面)中添加一个打开你某个菜单的按钮(默认关闭)
要求
- 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 中映射的任何自定义命令(见 Command mapping)。
权限
| 权限 |
描述 |
dialogsplus.edit |
使用游戏内编辑器(默认:op) |
重载、导出和导入使用在 config.yml 中设置的重载权限集。
警告: 请像对待控制台访问一样对待 dialogsplus.edit。拥有此权限的人可以创建 RUN_COMMAND_AS_CONSOLE 动作。仅授予受信任的管理员。
首次运行
在首次启动时,Dialogs+ 会创建以下目录结构:
plugins/DialogsPlus/
menus/ <- 在此放置你的菜单 .yml 文件
exports/ <- 你导出的菜单会出现在这里
imports/ <- 在导入之前将菜单文件放在这里
backups/ <- 由编辑器创建
config.yml <- 插件设置、命令映射、消息、游戏菜单按钮
README.txt <- 说明文档,首次运行时自动复制至此
菜单文件夹初始为空。使用 /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,占位符将在以下位置被替换:
- 菜单标题和外部标题
- 正文文本行
- 按钮标签
- 按钮工具提示
title: "Welcome, %player_name%"
body:
- "Your balance: %vault_eco_balance%"
如果未安装 PlaceholderAPI,这些字段将作为纯文本显示,占位符语法保持不变(不会出错,只是不会解析)。
颜色和 MiniMessage
菜单文本的每个部分都支持颜色代码和 MiniMessage:标题、外部标题、正文行、按钮标签、工具提示、输入标签、下拉选项和 SEND_MESSAGE 消息。config.yml 中的所有消息以及游戏菜单按钮文本也是如此。
- 旧版代码:
&a, &l, &r, ...(颜色代码也会清除之前的格式,就像原版聊天一样)
- 十六进制颜色:
&#ff8800 或 &x&f&f&8&8&0&0
- MiniMessage 标签:
<red>, <bold>, <gradient:red:blue>text</gradient>, <rainbow>, <#ff8800>, ...
- 两种样式可以混合使用,例如
"&6Welcome <gradient:aqua:blue>%player_name%</gradient>"
title: "<gradient:gold:yellow>Server Menu</gradient>"
body:
- "&aWelcome, &f%player_name%&a!"
玩家输入到输入框并通过 {id} 插入到 SEND_MESSAGE 中的文本,其标签和颜色代码首先会被剥离,以防止玩家注入格式。
游戏内编辑器显示原始文本,以便你编辑代码。预览显示着色结果。
游戏菜单按钮
在原版游戏菜单(Esc 屏幕)中添加一个按钮,用于打开其中一个菜单。默认关闭。
pause-menu:
enabled: false # 设置为 true 以开启
name: "Button" # 按钮上的文本(支持颜色和 MiniMessage)
menu: main # 按钮打开的菜单的 ID
- 需要完整重启服务器(
/dialogsplus reload 不适用)。
- 如果
name 为空,则使用菜单的标题。
- 只能将一个菜单附加到按钮上。
动作
当按钮被点击时,每个按钮的 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
- Colours everywhere:
& colour codes, &#rrggbb hex colours and full MiniMessage (gradients, rainbow and more) in every title, label, tooltip, body line, option and message. You can mix both styles.
- Game Menu button: optionally add a button to the vanilla Esc menu that opens one of your menus (off by default)
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, Game Menu button
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).
Colours and MiniMessage
Every piece of menu text supports colour codes and MiniMessage: titles, external titles, body lines, button labels, tooltips, input labels, dropdown options and SEND_MESSAGE messages. So do all messages in config.yml and the Game Menu button text.
- Legacy codes:
&a, &l, &r, ... (a colour code also clears earlier formatting, like in vanilla chat)
- Hex colours:
&#ff8800 or &x&f&f&8&8&0&0
- MiniMessage tags:
<red>, <bold>, <gradient:red:blue>text</gradient>, <rainbow>, <#ff8800>, ...
- Both styles can be mixed, e.g.
"&6Welcome <gradient:aqua:blue>%player_name%</gradient>"
title: "<gradient:gold:yellow>Server Menu</gradient>"
body:
- "&aWelcome, &f%player_name%&a!"
Text a player types into an input and inserts with {id} into a SEND_MESSAGE has its tags and colour codes stripped first, so players can't inject formatting.
The in-game editor shows the raw text so you can edit the codes. Preview shows the coloured result.
Game Menu button
Adds one button to the vanilla Game Menu (the Esc screen) that opens one of your menus. Off by default.
pause-menu:
enabled: false # set to true to turn it on
name: "Button" # text on the button (supports colours and MiniMessage)
menu: main # id of the menu the button opens
- Needs a full server restart (
/dialogsplus reload does not apply it).
- If
name is blank, the menu's title is used instead.
- Only one menu can be attached to the button.
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 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
登录后参与评分
还没有评论,来抢沙发吧