类 PlayerCommandSendEvent

java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
org.bukkit.event.player.PlayerCommandSendEvent

public class PlayerCommandSendEvent extends PlayerEvent
当服务器可用命令列表发送给玩家时触发本事件.
可以通过此事件来移除你不希望向玩家展示的某些命令, 但无需通过实现删除所有命令痕迹(?). 如果需要移除列表中的某些命令,可以给那些命令赋予一定的权限, 如果某个玩家没有命令需要的权限 那么他将无法通过Tab补全查到那个需要权限的命令.

原文: This event is called when the list of available server commands is sent to the player.
Commands may be removed from display using this event, but implementations are not required to securely remove all traces of the command. If secure removal of commands is required, then the command should be assigned a permission which is not granted to the player.

从以下版本开始:
Bukkit 1.13
  • 构造器详细资料

  • 方法详细资料

    • getCommands

      @NotNull public @NotNull Collection<String> getCommands()
      返回将发送给客户端的所有顶级命令的可变集合.
      向此集合添加条目是非法的, 你只能移除集合内的条目. 向此集合添加条目的行为是未定义的, 建议不要尝试.

      原文:Returns a mutable collection of all top level commands to be sent.
      It is not legal to add entries to this collection, only remove them. Behaviour of adding entries is undefined.

      返回:
      所有命令的集合
    • getHandlers

      @NotNull public @NotNull HandlerList getHandlers()
      指定者:
      getHandlers 在类中 Event
    • getHandlerList

      @NotNull public static @NotNull HandlerList getHandlerList()