
编程
Dragonphase - 专为 mau5ville.com 设计
额外致谢
如果您有 Java 经验和 Bukkit 插件开发经验,我将不胜感激您的帮助,并且有兴趣与开发者合作;我将重写 Commander 以使其更易于使用并提高代码生产效率。
我目前正在寻找一位能帮助我制作 Commander 的视频演示的人,展示其基本和高级功能。如果您对感兴趣,请在 Bukkit 上联系我——最好具备高水平的演示和/或评测能力。原因是大多数人会错过高级功能或不理解如何使用它们。
概述
Commander 是一个强大的设备接口工具,用于将命令、消息和语句分配给按钮、拉杆和压力板。
| 特性 |
|---|
| 向按钮、拉杆和压力板添加或删除多个命令 |
| 手动在 devices.yml 文件中添加和编辑现有设备数据 |
| 使用 if-else 语句检查玩家权限、物品和组别 |
| 以玩家、管理员或控制台身份执行命令 |
| 支持多权限系统 - 需要 Vault! |
| 向区域添加命令 - 需要 WorldGuard 和 WorldEdit! |
使用方法
首先,请确保您已安装 VAULT,以及它能够处理的所有权限插件(例如 PermissionsEx 或 bPermissions)。这允许对 Vault 页面上指定的所有基于权限的系统进行权限检测。
支持的设备
目前仅支持以下四种设备:
木压力板、石压力板、石按钮、木按钮、拉杆
命令类型
命令类型指定命令如何运行:
Player, Op, Console
您也可以使用 p, o 或 c 注意:非管理员无法使用 op 命令类型将自己提升为管理员,因为在所有命令启动后,它会撤销玩家的 OP 状态。但在控制台命令类型下是可能的。
命令
在游戏中输入命令时会显示这些命令的工作原理说明:
| 命令 | 描述 |
|---|---|
| /commander | 显示 commander 帮助信息。您也可以使用 /com |
| /commander add | 向您注视的设备添加命令。参见支持的设备 |
| /commander rem[ove] | 从您注视的设备中移除命令 |
| /commander clear | 清除您注视的设备的界面 |
| /commander check | 检查您注视的设备关联的所有命令 |
| /commander list | 显示所有世界中所有设备的列表 |
| /commander add-entry | 向您当前所在的区域添加命令 |
| /commander add-entry(regionName) | 向名为 regionName 的区域添加命令 |
| /commander rem-entry | 从您当前所在的区域移除命令 |
| /commander rem-entry(regionName) | 从名为 regionName 的区域移除命令 |
引用
引用为 Commander 的使用增添了非常强大的功能。引用允许您将玩家或服务器的特定属性显示给玩家。引用也可用于消息和语句中:
| 引用 | 描述 |
|---|---|
| @player OR @name | 玩家名称 |
| @group | 玩家组名 |
| @world | 玩家所在世界名称 |
| @time | 玩家所在世界时间 |
| @level | 玩家等级 |
| @exp OR @xp | 玩家经验值 |
| @health | 玩家生命值 |
| @food | 玩家饥饿值 |
| @mode OR @gm | 玩家游戏模式 |
| @server | 服务器 IP |
| @region | 您当前所在的区域名称 |
条件引用
通过 Commander,您可以强制命令继续执行下一条命令或停止运行后续命令。这在为设备添加条件语句时非常有用:
| 引用 | 描述 |
|---|---|
| @continue | 继续执行下一条命令 |
| @return | 不再执行后续命令 |
一个有用的示例如下:
@in admin>@@You are an admin>@return /give @player 57 1
这将检查玩家是否为管理员——如果他们在管理员组中,会向他们发送一条消息“你是管理员”,然后给予他们一个钻石块。如果他们不在管理员组中,则阻止其他任何命令执行。
关于条件引用的一点说明
条件引用中的命令与其他命令一样运行——如果你指定由玩家、OP 或控制台执行,它将以玩家、OP 或控制台的身份运行这些命令。
消息传递
如果该插件没有向玩家聊天屏幕发送自定义消息的方法,那它将毫无用处。支持所有颜色代码格式:
| 引用 | 描述 | 示例 |
|---|---|---|
| @@Message | 向发起设备的玩家发送“Message” | @@Hello @player! |
语句
语句允许你在满足条件时运行命令,否则可选择运行备用命令。如果你希望具有特定权限节点、组或物品的玩家运行命令,这将非常有用:
| 语句 | 描述 | 示例 |
|---|---|---|
| @check | 检查玩家是否具有特定的权限节点 | @check foo.bar>@@Yes>@@No |
| @has | 检查玩家是否具有特定物品 | @has 35>@@You have wool>@@You do not have wool |
| @in | 检查玩家是否在特定组中 | @in moderators>@@You are a moderator>@@You are a @group |
手动编辑设备
设备数据默认保存到 Commander/devices.yml。如果你使用的是早期版本的 Commander,只需将“commands.yml”重命名为“devices.yml”:
当你创建了一个空界面并希望手动向设备添加自己的命令时,手动编辑设备非常有用。这也适用于你希望添加默认情况下无法在 Minecraft 中输入的命令的情况,例如长 WorldEdit 生成命令。
默认情况下,devices.yml 文件中的命令不包含前斜杠 (/)。如果你想添加命令,只需写出不带前斜杠的内容即可。对于 WorldEdit 命令,你需要添加一个前斜杠(而不是两个):
| say hello | 普通 /say 命令 |
| /wand | WorldEdit 魔杖 |
权限
| 权限节点 | 描述 |
|---|---|
| commander.device.use.player | 允许玩家在设备上使用玩家命令(默认启用) |
| commander.device.use.op | 允许玩家在设备上使用 OP 命令 |
| commander.device.use.console | 允许玩家在设备上使用控制台命令 |
| commander.device.break | 允许玩家破坏设备 |
| commander.admin.add | 向设备添加命令 |
| commander.admin.remove | 从设备移除命令 |
| commander.admin.clear | 清除设备的界面 |
| commander.admin.check | 检查设备关联的命令 |
| commander.admin.list | 列出所有世界中的所有设备 |
| commander.admin.reload | 重新加载 Commander |
更多想法
- 我计划将所有引用转换为语句:
@player Bob>@@You are bob!>@@You are not bob!
@health 20>/give @player 57 1>@@You are not at full health
- 绊线钩支持
- 我已经研究过向任意方块添加命令的功能。
ba55ment:ba55ment.org

Programming
Dragonphase - designed for mau5ville.com
Additional Credit
If you have experience with Java and creating Bukkit plugins, I will greatly appreciate the help and am interested with working with developers; I will be rewriting Commander to make it easier to use and more efficient to produce code for.
I am currently looking for someone to help me produce a video demonstration of Commander, demonstrating basic and advanced features. Please message me on bukkit if you are interested - a high standard of demonstrative and/or reviewer abilities is preferred. The reason for this is that most people miss the advanced features or don't understand how to use them.
Overview
Commander is a powerful device interface tool used to assign commands, messages and statements to buttons, levers and pressure plates.
| Features |
|---|
| Add and remove multiple commands to buttons, levers and pressure plates |
| Manually add and edit existing device data in the devices.yml file |
| Check player permissions, items and groups using if-else statements |
| Perform commands as player, op or console |
| Multi-Perms support - Vault required! |
| Add commands to regions - WorldGuard and WorldEdit required! |
How to use
Firstly, make sure you have VAULT installed, as well as any of the permissions plugins it can handle (such as PermissionsEx or bPermissions). This allows permissions detection for all permissions-based systems specified on the Vault page.
Supported Devices
As of right now, only four devices are supported and listed below. Wooden Button will be easy to implement when 1.4 is released. I am currently in progress of developing a tripwire interface system for Commander:
Wooden Pressure Plate, Stone Pressure Plate, Stone Button, Wooden Button, Lever
Command Types
Command Types specify how the command will be run:
Player, Op, Console
You may also use p, o or c Note: it is impossible for non-ops to op themselves using the op command type, as after all commands have been initiated, it de-ops the player. It is possible on a console command type however.
Commands
An explanation of how these commands work is shown when you type the command in-game:
| Command | Description |
|---|---|
| /commander | Display the commander help. You can also use /com |
| /commander add | Add commands to the device you are looking at. See Supported Devices |
| /commander rem[ove] | Remove commands from the device you are looking at |
| /commander clear | Clear the interface of the device you are looking at |
| /commander check | Check all associated commands of the device you are looking at |
| /commander list | Show a list of all devices in all worlds |
| /commander add-entry | Add commands to the region you are standing in |
| /commander add-entry(regionName) | Add commands to the region named regionName |
| /commander rem-entry | Remove commands from the region you are standing in |
| /commander rem-entry(regionName) | Remove commands from the region named regionName |
References
References add a very powerful aspect to the uses of commander. References allow you to display specific traits of the player or the server to the player. References can also be used in messages and statements:
| Reference | Description |
|---|---|
| @player OR @name | Player name |
| @group | Player group name |
| @world | Player world name |
| @time | Player world time |
| @level | Player level |
| @exp OR @xp | Player experience |
| @health | Player health level |
| @food | Player food level |
| @mode OR @gm | Player game mode |
| @server | Server IP |
| @region | Name of the region you are standing in |
Conditional references
With commander, you can force the command to continue on to the next command or stop running any further commands. This is useful when adding conditional statements on devices:
| Reference | Description |
|---|---|
| @continue | Continue to the next command |
| @return | Do not run further commands |
An useful example of this is:
@in admin>@@You are an admin>@return /give @player 57 1
This will check if the player is an admin - if they are in the admin group, it sends a message to them saying "You are an admin" and then gives them one diamond block. if they are not in the admin group, @return sop any other commands from running.
A little note about conditional references
Commands in conditional references are run the same as any other commands - if you specify it to be run as the player, op or console, it will run them as the player, op or console.
Messaging
This plugin would be pretty useless if it didn't have a method to send custom messages to a player's chat screen. All color code formats are supported:
| Reference | Description | Example |
|---|---|---|
| @@Message | Send "Message" to the player who initiates the device | @@Hello @player! |
Statements
Statements allow you to run a command if a condition has been met, else optionally run an alternate command. This is useful if you want players with a specific permissions node, group or item to run a command:
| Statement | Description | Example |
|---|---|---|
| @check | Check if the player has a specific permission node | @check foo.bar>@@Yes>@@No |
| @has | Check if the player has a specific item | @has 35>@@You have wool>@@You do not have wool |
| @in | Check if the player is in a specific group | @in moderators>@@You are a moderator>@@You are a @group |
Manually editing devices
Device data is saved to Commander/devices.yml by default. if you are using an earlier version of Commander, simply rename "commands.yml" to "devices.yml":
Editing devices manually is useful when you have created an empty interface and wish to manually add your own commands to the device. This is also useful when you wish to add commands that cannot be entered into minecraft by default, such as long WorldEdit generation commands.
By defaults, commands in the devices.yml file do not contain a forward slash (/). If you want to add a command, simply write it out without the forward slash. With WorldEdit commands, you need to add one forward slash (instead of two):
| say hello | Normal /say command |
| /wand | WorldEdit wand |
Permissions
| Permission Node | Description |
|---|---|
| commander.device.use.player | Allow players to use player commands on devices (enabled by default) |
| commander.device.use.op | Allow players to use op commands on devices |
| commander.device.use.console | Allow players to use console commands on devices |
| commander.device.break | Allow players to break a device |
| commander.admin.add | Add a command to a device |
| commander.admin.remove | Remove a command from a device |
| commander.admin.clear | Clear a device's interface |
| commander.admin.check | Check a device's associated commands |
| commander.admin.list | List all devices in all worlds |
| commander.admin.reload | Reload commander |
Further Ideas
- I plan to convert all references into statements:
@player Bob>@@You are bob!>@@You are not bob!
@health 20>/give @player 57 1>@@You are not at full health
- Tripwire support
- I have LOOKED INTO adding commands to any block.
Homepage: dragonphase.com
ba55ment: ba55ment.org
下载 Commander
下载 Commander
下载 Commander
下载 Commander
下载 Commander
下载 Commander
下载 Commander
下载 Commander
下载 Commander
下载 Commander
重要更新
- WorldGuard 区域进入和退出命令(需要 WorldGuard 插件):
/com add-entry p|o|c <command1>[|command2...] 或 /com add-entry(区域名称) p|o|c <command1>[|command2...]
/com add-exit p|o|c <command1>[|command2...] 或 /com add-exit(区域名称) p|o|c <command1>[|command2...]
上述命令同样适用于从区域中移除命令,只需将 "add" 替换为 "rem" 即可。
- 添加了区域名称引用 - @region
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
插件
PacketEvents 是一款专为 Minecraft Java 版打造的协议库,旨在简化数据包的处理与传输。
插件
ExyliaPlugins 的库。
插件
通过对话框或铁砧界面帮助你的 Anthme
插件
重新定义服务器上的生物运输方式。使用高度可定制的口袋道具,安全地捕获、存储和释放任何实体。
插件
为基于 Spigot/Paper/Folia 的服务器添加对 Vivecraft 的支持
插件
用于绘制游戏内地图或在浏览器中随探索实时进行地图绘制的实时地图。
评论 0
登录后参与评分
还没有评论,来抢沙发吧