Class PlayerAvailableCommandsEvent

java.lang.Object
com.velocitypowered.api.event.command.PlayerAvailableCommandsEvent

@AwaitingEvent public class PlayerAvailableCommandsEvent extends Object
Allows plugins to modify the packet indicating commands available on the server to a Minecraft 1.13+ client. The given RootCommandNode is mutable. Velocity will wait for this event to finish firing before sending the list of available commands to the client.
  • Constructor Details

    • PlayerAvailableCommandsEvent

      public PlayerAvailableCommandsEvent(Player player, com.mojang.brigadier.tree.RootCommandNode<?> rootNode)
      Constructs an available commands event.
      Parameters:
      player - the targeted player
      rootNode - the Brigadier root node
  • Method Details

    • getPlayer

      public Player getPlayer()
      Gets the player that the available commands are being sent to.
      Returns:
      the targeted player
    • getRootNode

      public com.mojang.brigadier.tree.RootCommandNode<?> getRootNode()
      Gets the root command node that represents the available commands.
      Returns:
      the Brigadier root command node