EasyCommandBlocker 能做什么?
此插件允许你以快速且简单的方式完全屏蔽命令。你甚至可以在聊天中隐藏这些命令的 Tab 补全,或者定义一个显示允许的命令列表。
市面上有无数命令屏蔽插件,为什么还要做另一个?我制作这个插件仅仅是因为我找不到一个能在最近的 Minecraft 版本中正常工作的插件,大多数此类插件已过时或需要付费。
EasyCommandBlocker 已在以下环境测试通过:
- Paper 1.16.5 (搭配 ViaVersion, ViaBackwards, ViaRewind)(1.8-1.21 版本的命令 Tab 补全被隐藏)
- Purpur 1.18.2 (搭配 ViaVersion, ViaBackwards, ViaRewind)(1.8-1.21 版本的命令 Tab 补全被隐藏)
- Spigot 1.8.8 (搭配 ViaVersion)(1.8-1.21 版本的命令 Tab 补全被隐藏)
- Paper 1.16.5
- Paper 1.21.4+
- Waterfall
- Velocity
- Flamecord
功能特性
✅ 要屏蔽的命令列表
✅ 允许使用的命令列表
✅ 屏蔽所有命令的 Tab 补全
✅ 屏蔽冒号命令(如 /bukkit:help)
✅ 仅在 Tab 补全中显示特定命令(1.13+ 版本支持)
✅ 使用被屏蔽命令时可执行多种操作
- 发送消息
- 发送标题消息
- 播放音效
- 给予药水效果
- 执行控制台命令
✅ 针对特定命令组执行某些操作。
✅ 兼容 ViaVersion、ViaBackwards 和 ViaRewind。
✅ 兼容 Waterfall 和 Velocity(屏蔽 BungeeCord 命令并隐藏 Tab 补全)
✅ 兼容 1.8+ 版本
如何开始使用
SPIGOT/PAPER 服务器:
下载插件并将其放入你的 plugins 文件夹。该插件仅会屏蔽 Spigot 命令。
WATERFALL 和 VELOCITY 服务器:
下载插件并将其放入你的 plugins 文件夹。该插件仅会屏蔽代理命令。
你可以在代理服务器和游戏后端服务器中都使用该插件。
CONFIG.YML
剧透警告
# 在这里你可以创建不同的组,以便在 Tab 补全中只显示特定的命令。
# 你必须给予玩家 easycommandblocker.tab.<group> 权限才能使用此选项。
# 默认组将应用于所有未设置组权限的用户。
# 请勿删除默认组。
tab:
# 组的名称。
default:
# 优先级用于确定如果玩家拥有多个组权限时应优先使用哪个组。
# 更高的优先级意味着该组会被首先选中。
priority: 0
# 要在 Tab 补全中显示的命令列表。命令必须包含 "/"。
commands: []
vip:
priority: 1
# 你可以添加 "extends" 选项以从另一个组继承命令。
# 这样做可以避免重复输入命令。
extends: default
commands:
- "/home"
# 当用户尝试使用被屏蔽的命令时要执行的操作。
# 请参阅下一节以了解如何使用操作。
blocked_command_default_actions:
- 'message: &8[&b&lECB&8] &c你没有权限使用此命令。'
- 'playsound: BLOCK_NOTE_BLOCK_PLING;10;0.1'
- 'title: 20;40;20;&c你在干什么?;&7不要使用此命令!'
# 是否应在发现更新时向 OP 玩家发送加入通知
update_notify: true
# 仅限后端服务器的选项
# 如果你同时在代理和后端使用 ECB,请将其设置为 true。
is_network: false
# 仅限后端服务器的选项。
# 如果你使用的是 1.12- 服务器,或者希望添加对 1.12- 版本的兼容性,请将其设置为 true。
# 需要 ProtocolLib 插件。
# 要使此选项生效,你必须重启服务器。
legacy_support: false
# 如果将此选项设置为 true,下面的列表将作为白名单使用,
# 这意味着列出的命令将被允许,而其他所有命令都将被屏蔽。
use_commands_as_whitelist: false
# 要屏蔽的命令列表。
commands:
- "/?"
- "/bukkit:?"
- "/bukkit:ver"
- "/bukkit:version"
- "/bukkit:pl"
- "/bukkit:plugins"
- "/bukkit:help"
- "/bukkit:about"
- "/ver"
- "/version"
- "/plugins"
- "/pl"
- "/minecraft:me"
- "/about"
- "/icanhasbukkit"
# 屏蔽所有包含 ":" 的命令。
block_colon_commands: false
# 在这里你可以定义将执行某些操作的命令组。
# example1 部分定义了像 /ver 或 /version 这样的命令将会踢出
# 玩家,而不是使用默认操作。你必须使用与前面列表中相同的命令。
# 如果你不想自定义命令操作,可以删除整个这部分内容。
custom_commands_actions:
example1:
commands:
- "/ver"
- "/version"
- "/about"
actions:
- "console_command: kick %player% You can't see the version of the server!"
操作说明
你可以在 blocked_command_default_actions 选项中使用这些操作。Waterfall 和 Velocity 服务器也支持所有操作!
消息 (Message)
向玩家发送一条消息。
message: &8[&b&lECB&8] &c你没有权限使用此命令。
控制台命令 (Console Command)
从控制台执行命令。
console_command: kick %player%
播放音效 (Play Sound)
向玩家播放音效。请使用以下格式:"playsound: sound;volume;pitch".
你可以在此处找到音效列表:
[点击此处]
playsound: BLOCK_NOTE_BLOCK_PLING;10;0.1
标题 (Title)
向玩家发送标题和副标题消息。请使用以下格式:"title: fadeIn;stay;fadeOut;title;subtitle"
fadeIn, stay 和 fadeOut 必须以刻为单位,20刻 = 1秒
如果你只想显示标题或只想要副标题,请写 "none"
title: 20;40;20;&6这是一个标题;none
title: 20;40;20;&c你在干什么?;&7不要使用此命令!
给予药水效果
向玩家赋予药水效果。使用以下格式:"give_potion_effect: effect;duration_in_ticks;level"
你可以在这里找到药水效果列表:
[
give_potion_effect: BLINDNESS;180;1
重要信息
- 在 Tab 补全选项中,仅能显示已注册且玩家拥有正确权限使用的命令。这是 Minecraft 的限制,无法将自定义命令添加到该列表中。
- 测试插件时,请先执行 /deop 解除自身的 OP 状态,因为 OP 玩家会绕过所有选项。
- 本插件不适用于 BungeeCord,仅适用于 Waterfall 和 Velocity。
API
本插件提供了一个小型 API,包含一个事件:
剧透
@EventHandler
public void onBlockedCommand(CommandBlockedEvent event){
Player player = event.getPlayer();
//从配置中检测到的命令
String command = event.getCommand();
//玩家使用的完整命令
String fullCommand = event.getFullCommand();
}
命令与权限
命令
(别名: /ecb)
- /easycommandblocker reload (重载配置文件)
权限:
- easycommandblocker.admin (允许访问 /ecb reload 命令)
- easycommandblocker.tab.<group> (允许使用特定的 Tab 补全组)
- easycommandblocker.bypass.tab (允许完全绕过 Tab 补全过滤器)
- easycommandblocker.bypass.commands (允许完全绕过被阻止的命令)
What can I do with EasyCommandBlocker?
This plugin allows you to completely block commands in a fast and easy way. You can even hide these commands from tab completion in the chat, or define a list of permitted commands to show.
There are countless of command blocker plugins, why another? I made this plugin simply because I couldn't find one that manages to work properly in recent Minecraft versions, most of these plugins are outdated or paid.
EasyCommandBlocker has been tested on:
- Paper 1.16.5 with ViaVersion, ViaBackwards, ViaRewind (Command tab completion is hidden for 1.8-1.21 versions)
- Purpur 1.18.2 with ViaVersion, ViaBackwards, ViaRewind (Command tab completion is hidden for 1.8-1.21 versions)
- Spigot 1.8.8 with ViaVersion (Command tab completion is hidden for 1.8-1.21 versions)
- Paper 1.16.5
- Paper 1.21.4+
- Waterfall
- Velocity
- Flamecord
FEATURES
✅ List of commands to block
✅ List of commands to allow
✅ Block tab completion of all commands
✅ Block colon commands
✅ Show only certain commands on tab completion (1.13+)
✅ Multiple actions when using blocked command
- Send message
- Send title message
- Play sound
- Give potion effect
- Execute console command
✅ Certain actions to group of commands.
✅ Works with ViaVersion, ViaBackwards and ViaRewind.
✅ Works on Waterfall and Velocity (blocks bungee commands and hide tab completion)
✅ Works with 1.8+
HOW TO START
SPIGOT/PAPER SERVERS:
Download the plugin and place it on your plugins folder. The plugin will only block spigot commands.
WATERFALL AND VELOCITY SERVERS:
Download the plugin and place it on your plugins folder. The plugin will only block proxy commands.
You can use the plugin in both the proxy and your game servers.
CONFIG.YML
Spoiler
# Here you can create different groups to show only certain commands
# in tab completion. You must give the easycommandblocker.tab.<group>
# permission to players for using this option.
# The default group will apply to ALL users that don't have a group permission set.
# Don't remove the default group.
tab:
# Name of the group.
default:
# The priority works to define which group a player must use first if they
# have more than one group permission. A higher priority means the
# group will be selected first.
priority: 0
# A list of commands to show on tab completion. The command must
# include the "/".
commands: []
vip:
priority: 1
# You can add the "extends" option to inherit commands from another
# group. Doing so allows you to not repeat commands.
extends: default
commands:
- "/home"
# Actions to be executed when a user tries to use a blocked command.
# See the next section to understand how to use actions.
blocked_command_default_actions:
- 'message: &8[&b&lECB&8] &cYou don''t have permissions to use that command.'
- 'playsound: BLOCK_NOTE_BLOCK_PLING;10;0.1'
- 'title: 20;40;20;&cWhat are you doing?;&7Don''t use that command!'
# Whether the plugin should send notifications on join to OP
# players if an update is found
update_notify: true
# Option only in backend server
# Set it to true if you are using ECB in both the proxy and the backend.
is_network: false
# Option only in backend server.
# Set it to true if you are using a 1.12- server or want to add compatibility
# with 1.12- versions.
# Requires ProtocolLib.
# For this option to apply you must restart your server.
legacy_support: false
# If you set this option to true, the list below will serve as a whitelist instead,
# meaning the listed commands will be allowed and all others will be blocked.
use_commands_as_whitelist: false
# List of commands to block.
commands:
- "/?"
- "/bukkit:?"
- "/bukkit:ver"
- "/bukkit:version"
- "/bukkit:pl"
- "/bukkit:plugins"
- "/bukkit:help"
- "/bukkit:about"
- "/ver"
- "/version"
- "/plugins"
- "/pl"
- "/minecraft:me"
- "/about"
- "/icanhasbukkit"
# Block all commands that contain ":".
block_colon_commands: false
# Here you can define group of commands that will execute certain actions.
# The example1 section defines that commands like /ver or /version will kick
# the player from the server, instead of using the default actions. You MUST use
# the same commands defined in the previous list.
# If you don't want custom command actions, you can delete this whole section.
custom_commands_actions:
example1:
commands:
- "/ver"
- "/version"
- "/about"
actions:
- "console_command: kick %player% You can't see the version of the server!"
ACTIONS
You can use these actions on the blocked_command_default_actions option. Waterfall and Velocity servers support all actions as well!
Message
Sends a message to the player.
message: &8[&b&lECB&8] &cYou don't have permissions to use that command.
Console Command
Executes a command from the console.
console_command: kick %player%
Play Sound
Plays a sound to the player. Use this format: "playsound: sound;volume;pitch".
You can find a list of sounds here:
[CLICK]
playsound: BLOCK_NOTE_BLOCK_PLING;10;0.1
Title
Sends a title and subtitle message to the player. Use this format: "title: fadeIn;stay;fadeOut;title;subtitle"
fadeIn, stay and fadeOut must be in ticks, 20ticks = 1second
If you want just a title, or just subtitle write "none"
title: 20;40;20;&6This is a title;none
title: 20;40;20;&cWhat are you doing?;&7Don't use that command!
Give Potion Effect
Gives a potion effect to the player. Use this format: "give_potion_effect: effect;duration_in_ticks;level"
You can find a list of potion effects here:
[
give_potion_effect: BLINDNESS;180;1
IMPORTANT INFORMATION
- On the tab option you can only display commands that are registered and players have the correct permissions to use. This is a Minecraft limitation, it's not possible to add custom commands to that list.
- Remember to /deop yourself first when testing the plugin since OP players will bypass all options.
- The plugin doesn't work on BungeeCord, only on Waterfall and Velocity.
API
The plugin has a small API that includes an Event:
Spoiler
@EventHandler
public void onBlockedCommand(CommandBlockedEvent event){
Player player = event.getPlayer();
//Detected command from the config
String command = event.getCommand();
//The complete command used by the player
String fullCommand = event.getFullCommand();
}
COMMANDS AND PERMISSION
COMMANDS
(alias: /ecb)
- /easycommandblocker reload (Reloads the config)
PERMISSIONS:
- easycommandblocker.admin (Allows the access to /ecb reload)
- easycommandblocker.tab.<group> (Allows the use of a certain tab completion group)
- easycommandblocker.bypass.tab (Allows to completely bypass tab completion filters)
- easycommandblocker.bypass.commands (Allows to completely bypass blocked commands)
评论 0
登录后参与评分
还没有评论,来抢沙发吧