Disable specified commands in Minecraft to protect server security.
一个简单而实用的Minecraft Bukkit/Spigot插件,用于禁用Minecraft原版或其他插件的命令。
A simple and practical Minecraft Bukkit/Spigot plugin for disabling vanilla Minecraft commands or commands from other plugins.
插件首次启动后,会在plugins/DisableCommand文件夹中生成DisableCommands.yml文件。配置文件内容如下:
When the plugin starts for the first time, it will generate a DisableCommands.yml file in the plugins/DisableCommand folder. The configuration file contains the following:
# DisableCommand配置文件
# 在此处添加你想要禁用的命令,无需包含斜杠
# Example: disabled-commands: ["gamemode", "tp", "give"]
disabled-commands:
- gamemode
- tp
- give
# 当玩家尝试执行禁用命令时显示的消息
# 使用 & 符号作为颜色代码前缀,例如:"&eDisable&cCommand &a>> &4这个命令已被禁用!"
# Message displayed when a player attempts to execute a disabled command
# Use & symbol as color code prefix, e.g.: "&eDisable&cCommand &a>> &4This command has been disabled!"
disabled-message: "&eDisable&cCommand &a>> &4这个命令已被禁用!"
编辑plugins/DisableCommand/DisableCommands.yml文件,在disabled-commands列表中添加你想要禁用的命令。例如:
Edit the plugins/DisableCommand/DisableCommands.yml file and add the commands you want to disable to the disabled-commands list. For example:
disabled-commands:
- gamemode
- tp
- give
- op
- kill
修改配置文件后,可以使用以下命令重载配置,无需重启服务器:
After modifying the configuration file, you can use the following command to reload the configuration without restarting the server:
/disablecommand reload
或者使用简写版本:
Or use the shorthand version:
/dc reload
注意:只有拥有disablecommand.reload权限的玩家才能使用此命令,默认情况下只有OP拥有此权限。
Note: Only players with the disablecommand.reload permission can use this command, which is by default only available to OPs.
A: 目前插件只禁用命令本身,不考虑参数。如果你禁用了tp命令,那么所有以/tp开头的命令都会被禁用。
A: Currently, the plugin only disables the command itself, not considering parameters. If you disable the tp command, all commands starting with /tp will be disabled.
A: 与禁用原版命令的方法相同,只需在配置文件中添加插件命令的名称即可。
A: The same way as disabling vanilla commands, simply add the name of the plugin command to the configuration file.
A: 一些特殊命令可能通过其他方式执行,不受PlayerCommandPreprocessEvent事件的影响。
A: Some special commands may be executed through other means and are not affected by the PlayerCommandPreprocessEvent.
A: 为了方便服务器管理,插件默认允许OP和拥有disablecommand.bypass权限的玩家执行所有命令。
A: For server management convenience, the plugin by default allows OPs and players with disablecommand.bypass permission to execute all commands.
如果您是开发者,想要修改或扩展此插件,可以使用以下命令编译:
If you are a developer and want to modify or extend this plugin, you can compile it using the following command:
mvn clean install
编译后的插件文件将位于target目录中。
The compiled plugin file will be located in the target directory.
此插件采用MIT许可证开源。
This plugin is open-source under the MIT License.