CustomGUI
一款灵活、基于 YAML 的 Spigot 1.20.1 GUI 引擎。
CustomGUI 允许服务器管理员使用简单的 YAML 文件创建完全可定制的库存菜单。无需编写 Java 代码,即可配置布局、物品、权限、冷却时间、点击动作、导航和动态刷新。
CustomGUI 专为开发者和服务器所有者设计,还提供了公共 API 和自定义事件,以便与其他插件集成。
特性
? 完全可定制的 GUI
- 配置 1–9 列 和 1–6 行 的 GUI 尺寸。
- 将物品布局左对齐、居中或右对齐。
- 使用坐标、位置列表或槽位范围定位物品。
- 使用可配置的填充物填充空槽。
- 使用传统颜色代码和十六进制颜色自定义标题。
? 丰富的物品配置
- 自定义材质、名称和描述(Lore)。
- 传统颜色(
&a)和十六进制颜色(&#RRGGBB)。
- 附魔发光效果。
- 支持自定义模型数据(Model Data)。
- 每个物品的独立权限和冷却时间。
- 内置占位符:
%player% — 玩家名称。
%displayname% — 玩家显示名称。
%uuid% — 玩家 UUID。
%world% — 当前世界。
%online% — 在线玩家数量。
%gui% — 当前 GUI 标识符。
⚡ 强大的点击动作
为每种鼠标输入配置不同的动作:
- 左键点击
- 右键点击
- Shift+左键点击
- Shift+右键点击
- 中键点击
- 针对任意点击的回退动作
支持按顺序链接多个动作,并支持延迟。
| 动作 |
描述 |
[player] |
以玩家身份执行命令 |
[console] |
以控制台身份执行命令 |
[message] |
发送聊天消息 |
[actionbar] |
显示操作栏消息 |
[title] |
显示标题和副标题 |
[sound] |
播放音效 |
[open] |
打开另一个 GUI |
[close] |
关闭当前 GUI |
[refresh] |
刷新当前 GUI |
[delay] |
延迟后续动作 |
GUI 还可以定义 open_actions 和 close_actions,以便在打开或关闭时执行动作。
? 动态 GUI
- 以可配置的间隔自动刷新菜单。
- 更新动态内容,无需重启服务器。
- 使用单个命令重新加载配置和所有 GUI 文件。
? 库存安全
- 取消受管 GUI 内的库存点击和拖拽。
- 防止玩家通过常规库存交互取出 GUI 物品。
- 减少Shift键点击复制和物品被盗的风险。
- 在主服务器线程上,点击发生后的一个刻(tick)调度点击动作。
?️ 开发者 API
CustomGUI 公开了用于与其他插件集成的公共 API。
可用事件:
GuiOpenEvent
GuiClickEvent — 可取消
GuiCloseEvent
通过以下方式访问 GUI 管理器:
CustomGUI.getInstance().getGuiManager()
命令
| 命令 |
描述 |
/customgui gui open <gui> [player|@p|@a|@r|@s] |
打开一个 GUI |
/customgui gui close [player] |
关闭一个 GUI |
/customgui gui list |
列出已加载的 GUI |
/customgui reload |
重新加载配置和 GUI 文件 |
别名: /cgui
权限
| 权限 |
描述 |
默认值 |
customgui.admin |
访问所有 CustomGUI 命令 |
OP |
示例配置
为你的 GUI 创建一个 YAML 文件,例如 main-menu.yml:
title: "&#FFAA00&l主菜单"
columns: 9
rows: 3
filler:
material: BLACK_STAINED_GLASS_PANE
name: " "
items:
heal:
material: GOLDEN_APPLE
position: "4,1"
glow: true
name: "7FF55&l治疗"
cooldown: 100
actions:
left:
- "[console] effect give %player% minecraft:instant_health 1 1 true"
- "[sound] entity.player.levelup 1 1.5"
- "[message] &a你已被治愈!"
此示例创建了一个三行的菜单,其中包含一个发光的金苹果,点击后会给玩家施加短暂的瞬间生命效果。
要求
| 要求 |
版本 |
| Minecraft |
1.20.1 |
| 服务器软件 |
Spigot 或兼容分支 |
| Java |
17 或更高版本 |
快速开始
- 在服务器上安装 CustomGUI。
- 参考上述示例为你的 GUI 创建一个 YAML 文件。
- 加载或重新加载配置。
- 使用
/customgui gui open <gui> 打开你的菜单。
有关确切的配置目录、支持的 YAML 选项和动作语法,请参阅项目的文档。
支持
发现错误或有任何功能请求?请通过项目的问题跟踪器进行报告。
CustomGUI — 无需为每个 GUI 编写自定义插件,即可构建强大的服务器菜单。
CustomGUI
A flexible, YAML-powered GUI engine for Spigot 1.20.1.
CustomGUI lets server administrators create fully customizable inventory menus using simple YAML files. Configure layouts, items, permissions, cooldowns, click actions, navigation, and dynamic refreshes without writing Java code.
Designed for developers and server owners, CustomGUI also provides a public API and custom events for integration with other plugins.
Features
? Fully Customizable GUIs
- Configure GUI dimensions with 1–9 columns and 1–6 rows.
- Align item layouts to the left, center, or right.
- Position items using coordinates, position lists, or slot ranges.
- Fill empty slots with configurable filler items.
- Customize titles with legacy color codes and hex colors.
? Rich Item Configuration
- Custom materials, names, and lore.
- Legacy colors (
&a) and hex colors (&#RRGGBB).
- Enchantment glow effects.
- Custom Model Data support.
- Per-item permissions and cooldowns.
- Built-in placeholders:
%player% — Player name.
%displayname% — Player display name.
%uuid% — Player UUID.
%world% — Current world.
%online% — Online player count.
%gui% — Current GUI identifier.
⚡ Powerful Click Actions
Configure different actions for each mouse input:
- Left-click
- Right-click
- Shift-left-click
- Shift-right-click
- Middle-click
- Fallback actions for any click
Chain multiple actions in sequence, with support for delays.
| Action |
Description |
[player] |
Execute a command as the player |
[console] |
Execute a command as the console |
[message] |
Send a chat message |
[actionbar] |
Display an action bar message |
[title] |
Display a title and subtitle |
[sound] |
Play a sound |
[open] |
Open another GUI |
[close] |
Close the current GUI |
[refresh] |
Refresh the current GUI |
[delay] |
Delay subsequent actions |
GUIs can also define open_actions and close_actions to run actions when opened or closed.
? Dynamic GUIs
- Automatically refresh menus at a configurable interval.
- Update dynamic content without requiring a server restart.
- Reload the configuration and all GUI files using a single command.
? Inventory Safety
- Cancel inventory clicks and drags inside managed GUIs.
- Prevent players from taking GUI items through normal inventory interactions.
- Reduce shift-click duplication and item theft risks.
- Schedule click actions one tick after the click, on the main server thread.
?️ Developer API
CustomGUI exposes a public API for integration with other plugins.
Available events:
GuiOpenEvent
GuiClickEvent — Cancellable
GuiCloseEvent
Access the GUI manager through:
CustomGUI.getInstance().getGuiManager()
Commands
| Command |
Description |
/customgui gui open <gui> [player|@p|@a|@r|@s] |
Open a GUI |
/customgui gui close [player] |
Close a GUI |
/customgui gui list |
List loaded GUIs |
/customgui reload |
Reload the configuration and GUI files |
Alias: /cgui
Permissions
| Permission |
Description |
Default |
customgui.admin |
Access to all CustomGUI commands |
OP |
Example Configuration
Create a YAML file for your GUI, for example main-menu.yml:
title: "&#FFAA00&lMain Menu"
columns: 9
rows: 3
filler:
material: BLACK_STAINED_GLASS_PANE
name: " "
items:
heal:
material: GOLDEN_APPLE
position: "4,1"
glow: true
name: "7FF55&lHeal"
cooldown: 100
actions:
left:
- "[console] effect give %player% minecraft:instant_health 1 1 true"
- "[sound] entity.player.levelup 1 1.5"
- "[message] &aYou have been healed!"
This example creates a three-row menu with a glowing Golden Apple that grants the player a short instant-health effect when clicked.
Requirements
| Requirement |
Version |
| Minecraft |
1.20.1 |
| Server software |
Spigot or compatible fork |
| Java |
17 or newer |
Getting Started
- Install CustomGUI on your server.
- Create a YAML file for your GUI using the example above.
- Load or reload the configuration.
- Open your menu using
/customgui gui open <gui>.
Consult the project's documentation for the exact configuration directory, supported YAML options, and action syntax.
Support
Found a bug or have a feature request? Report it through the project's issue tracker.
CustomGUI — Build powerful server menus without writing a custom plugin for every GUI.
评论 0
登录后参与评分
还没有评论,来抢沙发吧