CommandGUI 插件
概述
CommandGUI 是一款 Minecraft Spigot 插件,它为玩家提供了一个自定义图形用户界面(GUI),以便在与 GUI 交互时以玩家身份执行命令。该 GUI 完全可配置,允许您定义物品、命令和布局。玩家还可以获得一个自定义物品,在使用时即可打开 GUI。
功能
- 自定义 GUI:一个对玩家友好的界面,通过点击即可执行命令。
- 可配置物品:通过配置文件在 GUI 中定义物品、它们的外观以及它们执行的命令。
- 动态库存大小:根据物品数量自动调整 GUI 的大小。
- 自定义工具:玩家可以使用自定义工具来打开 GUI。
- 命令重载:使用
/commandgui reload 轻松重新加载插件的配置。
命令
/commandgui
- 描述: 为玩家打开 Command GUI。
- 别名:
/cg
/commandgui tool
- 描述: 给玩家一个在使用时打开 Command GUI 的工具。
- 别名:
/cg tool
/commandgui give <player>
- 描述: 将指定的玩家授予 Command GUI 工具。
- 别名:
/cg give <player>
/commandgui help
- 描述: 显示所有插件命令。
- 别名:
/cg help
/commandgui reload
- 描述: 重新加载插件的配置。
- 别名:
/cg reload
权限
| 权限 |
描述 |
默认值 |
commandgui.use |
允许玩家打开 GUI。 |
OP |
commandgui.bypass |
允许玩家绕过冷却时间。 |
OP |
commandgui.tool |
给予玩家打开 GUI 的工具。 |
OP |
commandgui.give |
将 GUI 工具给予其他玩家。 |
OP |
commandgui.reload |
允许重新加载插件配置。 |
OP |
安装
- 下载 CommandGUI 插件的
.jar 文件。
- 将
.jar 文件放入服务器的 plugins 目录中。
- 启动服务器以生成默认配置文件。
- 通过编辑
plugins/CommandGUI/config.yml 来配置插件。
- 使用
/commandgui reload 重新加载插件或重启服务器。
配置
config.yml 文件允许您自定义 GUI 中的物品。
# 常规设置
language-file: "en_us.yml" # 默认语言文件。更改语言会导致现有的 CommandGUI 工具失效!
verbose-mode: false # 设置为 true 以全局启用所有物品的详细消息(默认回退)
gui-size-mode: "dynamic" # 选项:"dynamic", "fixed"
gui-tool: "COMPASS" # 这是由 "/cg tool" 提供的用于打开 GUI 的物品
gui-items:
- slot: 0
name: "&a前往出生点"
command: "spawn"
item: "COMPASS"
run-as-player: true
cooldown: 0 # 无冷却时间
verbose: true # 始终记录与此物品的交互
lore:
- "&7点击传送至出生点"
- slot: 1
name: "&c治疗"
command: "heal"
item: "GOLDEN_APPLE"
run-as-player: true
cooldown: 30 # 30 秒冷却时间
verbose: false # 从不记录与此物品的交互
lore:
- "&7点击治疗自己"
- slot: 2
name: "&b钻石"
command: "give %player% diamond 1"
item: "DIAMOND"
run-as-player: false
cooldown: 60 # 60 秒冷却时间
# 没有 verbose 字段;回退到全局 verbose-mode
lore:
- "&b获得一颗钻石!"
- "&3这是一个服务器奖励。"
配置选项
常规设置
language-file:要使用的语言文件(默认:en_us.yml)。
verbose-mode:如果为 true,则全局显示物品交互的详细消息(默认:false)。
gui-size-mode:确定 GUI 的大小。选项:
"dynamic":根据物品数量调整库存大小。
"fixed":将 GUI 大小设置为固定的双箱(54 个槽位)。
gui-tool:设置用于打开 GUI 的工具。
GUI 物品
GUI 中的每个物品都有以下选项:
name:GUI 中物品的显示名称,支持颜色代码(例如,&a前往出生点)。
command:点击物品时执行的命令(例如,spawn 或 give %player% diamond 1)。
item:物品的材质(例如,DIAMOND, GOLDEN_APPLE, COMPASS)。
slot:物品的库存槽位(可选,如果未提供则自动递增)。
lore:显示为物品背景文本的文本行列表(可选,支持颜色代码)。
run-as-player:如果为 true,命令将以玩家身份运行。如果为 false,命令将以控制台身份运行(默认:false)。
cooldown:可以再次使用该物品之前的冷却时间(秒)(默认:0 表示无冷却时间)。
verbose:如果为 true,则覆盖全局 verbose-mode 并为该物品启用详细日志记录(可选)。
用法
-
打开 GUI:
- 使用
/commandgui 命令打开 GUI。
- 或者,使用
/commandgui tool 提供的工具。
-
添加物品:
- 编辑
config.yml 文件以添加或修改 GUI 中的物品。
- 使用
/commandgui reload 重新加载配置。
贡献
欢迎贡献!请分叉仓库,进行修改,并提交拉取请求。
许可证
本插件根据 Apache License 2.0 许可。
感谢您使用 CommandGUI
CommandGUI Plugin
Overview
CommandGUI is a Minecraft Spigot plugin that provides players with a custom GUI to execute commands as the player interacting with the GUI. The GUI is fully configurable, allowing you to define items, commands, and layout. Players can also receive a custom item that opens the GUI when used.
Features
- Custom GUI: A player-friendly interface to execute commands with a click.
- Configurable Items: Define items, their appearance, and the commands they execute in the GUI via the configuration file.
- Dynamic Inventory Sizing: Automatically adjusts the GUI size based on the number of items.
- Customisable Tool: Players can use a custom tool to open the GUI.
- Command Reload: Easily reload the plugin's configuration with
/commandgui reload.
Commands
/commandgui
- Description: Opens the Command GUI for the player.
- Aliases:
/cg
/commandgui tool
- Description: Gives the player a tool that opens the Command GUI when used.
- Aliases:
/cg tool
/commandgui give <player>
- Description: Gives the specified player the Command GUI Tool.
- Aliases:
/cg give <player>
/commandgui help
- Description: Displays all the plugin's commands.
- Aliases:
/cg help
/commandgui reload
- Description: Reloads the plugin's configuration.
- Aliases:
/cg reload
Permissions
| Permission |
Description |
Default |
commandgui.use |
Allows player to open the GUI. |
OP |
commandgui.bypass |
Allows player to bypass cooldowns. |
OP |
commandgui.tool |
Gives player a tool to open the GUI. |
OP |
commandgui.give |
Gives another player the GUI Tool. |
OP |
commandgui.reload |
Allows reloading the plugin config. |
OP |
Installation
- Download the CommandGUI plugin
.jar file.
- Place the
.jar file in your server's plugins directory.
- Start the server to generate the default configuration file.
- Configure the plugin by editing
plugins/CommandGUI/config.yml.
- Reload the plugin with
/commandgui reload or restart the server.
Configuration
The config.yml file allows you to customize the items in the GUI.
# General settings
language-file: "en_us.yml" # Default language file. Changing languages will break existing CommandGUI tools!
verbose-mode: false # Set to true to enable verbose messages globally for all items (default fallback)
gui-size-mode: "dynamic" # Options: "dynamic", "fixed"
gui-tool: "COMPASS" # This is the item used to open the GUI given by "/cg tool"
gui-items:
- slot: 0
name: "&aGo to Spawn"
command: "spawn"
item: "COMPASS"
run-as-player: true
cooldown: 0 # No cooldown
verbose: true # Always log interaction for this item
lore:
- "&7Click to teleport to spawn"
- slot: 1
name: "&cHeal"
command: "heal"
item: "GOLDEN_APPLE"
run-as-player: true
cooldown: 30 # 30 seconds cooldown
verbose: false # Never log interaction for this item
lore:
- "&7Click to heal yourself"
- slot: 2
name: "&bDiamonds"
command: "give %player% diamond 1"
item: "DIAMOND"
run-as-player: false
cooldown: 60 # 60 seconds cooldown
# No verbose field; falls back to global verbose-mode
lore:
- "&bReceive a diamond!"
- "&3This is a server reward."
Configuration Options
General Settings
language-file: The language file to use (default: en_us.yml).
verbose-mode: If true, displays verbose messages for item interactions globally (default: false).
gui-size-mode: Determines the size of the GUI. Options:
"dynamic": Adjusts the inventory size based on the number of items.
"fixed": Sets the GUI size to a fixed double chest (54 slots).
gui-tool: Sets the tool used to open the GUI.
GUI Items
Each item in the GUI has the following options:
name: The display name of the item in the GUI, with color codes supported (e.g., &aGo to Spawn).
command: The command executed when the item is clicked (e.g., spawn or give %player% diamond 1).
item: The item's material (e.g., DIAMOND, GOLDEN_APPLE, COMPASS).
slot: The inventory slot for the item (optional, auto-increment if not provided).
lore: A list of text lines displayed as the item's lore (optional, supports color codes).
run-as-player: If true, the command will run as the player. If false, the command will run as the console (default: false).
cooldown: The cooldown in seconds before the item can be used again (default: 0 for no cooldown).
verbose: If true, overrides the global verbose-mode and enables verbose logging for this item (optional).
Usage
-
Opening the GUI:
- Use the
/commandgui command to open the GUI.
- Alternatively, use the tool provided with
/commandgui tool.
-
Adding Items:
- Edit the
config.yml file to add or modify items in the GUI.
- Reload the configuration with
/commandgui reload.
Contributing
Contributions are welcome! Please fork the repository, make your changes, and submit a pull request.
License
This plugin is licensed under the Apache License 2.0.
Thanks for using CommandGUI
评论 0
登录后参与评分
还没有评论,来抢沙发吧