Class CommandRegisteredEvent<S extends BukkitBrigadierCommandSource>

java.lang.Object
org.bukkit.event.Event
org.bukkit.event.server.ServerEvent
com.destroystokyo.paper.event.brigadier.CommandRegisteredEvent<S>
All Implemented Interfaces:
org.bukkit.event.Cancellable

@Deprecated public class CommandRegisteredEvent<S extends BukkitBrigadierCommandSource> extends org.bukkit.event.server.ServerEvent implements org.bukkit.event.Cancellable
Deprecated.
Draft API - Subject to change until confirmed solves desired use cases
Fired anytime the server synchronizes Bukkit CommandMap to Brigadier. Allows a plugin to control the Literal and Argument nodes for this command to be sent to the client. This is done at Plugin Enable time after commands have been registered, but some plugins may use reflection to retrigger this rebuild during runtime.
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.bukkit.event.Event

    org.bukkit.event.Event.Result
  • Constructor Summary

    Constructors
    Constructor
    Description
    CommandRegisteredEvent(String commandLabel, BukkitBrigadierCommand<S> brigadierCommand, org.bukkit.command.Command command, com.mojang.brigadier.tree.RootCommandNode<S> root, com.mojang.brigadier.tree.LiteralCommandNode<S> literal, com.mojang.brigadier.tree.ArgumentCommandNode<S,String> defaultArgs)
    Deprecated.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Deprecated.
     
    org.bukkit.command.Command
    Deprecated.
     
    Deprecated.
     
    com.mojang.brigadier.tree.ArgumentCommandNode<S,String>
    Deprecated.
    Returns the Bukkit API's default handling of Arguments, if you wish to reuse it.
    static @NotNull org.bukkit.event.HandlerList
    Deprecated.
     
    @NotNull org.bukkit.event.HandlerList
    Deprecated.
     
    com.mojang.brigadier.tree.LiteralCommandNode<S>
    Deprecated.
    Returns the Bukkit API's default literal for this command, including the getDefaultArgs() as a child already.
    com.mojang.brigadier.tree.RootCommandNode<S>
    Deprecated.
     
    boolean
    Deprecated.
    void
    setCancelled(boolean cancel)
    Deprecated.
    Cancels registering this command to Brigadier, but will remain in Bukkit Command Map.
    void
    setLiteral(com.mojang.brigadier.tree.LiteralCommandNode<S> literal)
    Deprecated.
    Changes the literal used to register this command.

    Methods inherited from class org.bukkit.event.Event

    callEvent, getEventName, isAsynchronous

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CommandRegisteredEvent

      public CommandRegisteredEvent(String commandLabel, BukkitBrigadierCommand<S> brigadierCommand, org.bukkit.command.Command command, com.mojang.brigadier.tree.RootCommandNode<S> root, com.mojang.brigadier.tree.LiteralCommandNode<S> literal, com.mojang.brigadier.tree.ArgumentCommandNode<S,String> defaultArgs)
      Deprecated.
  • Method Details

    • getCommandLabel

      public String getCommandLabel()
      Deprecated.
      Returns:
      The command name being registered
    • getBrigadierCommand

      public BukkitBrigadierCommand<S> getBrigadierCommand()
      Deprecated.
      Returns:
      The Bukkit API Brigadier Wrapped Command Object to handle executions and suggestions
    • getCommand

      public org.bukkit.command.Command getCommand()
      Deprecated.
    • getRoot

      public com.mojang.brigadier.tree.RootCommandNode<S> getRoot()
      Deprecated.
      Returns:
      Gets the root command node being used to register a command to.
    • getDefaultArgs

      public com.mojang.brigadier.tree.ArgumentCommandNode<S,String> getDefaultArgs()
      Deprecated.
      Returns the Bukkit API's default handling of Arguments, if you wish to reuse it.
      Returns:
    • getLiteral

      public com.mojang.brigadier.tree.LiteralCommandNode<S> getLiteral()
      Deprecated.
      Returns the Bukkit API's default literal for this command, including the getDefaultArgs() as a child already.
      Returns:
    • setLiteral

      public void setLiteral(com.mojang.brigadier.tree.LiteralCommandNode<S> literal)
      Deprecated.
      Changes the literal used to register this command. The previous literable is mutable, so this is primarily if you want to completely replace the object.
      Parameters:
      literal -
    • isCancelled

      public boolean isCancelled()
      Deprecated.
      Specified by:
      isCancelled in interface org.bukkit.event.Cancellable
    • setCancelled

      public void setCancelled(boolean cancel)
      Deprecated.
      Cancels registering this command to Brigadier, but will remain in Bukkit Command Map. Can be used to hide a command from all players.
      Specified by:
      setCancelled in interface org.bukkit.event.Cancellable
    • getHandlers

      @NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()
      Deprecated.
      Specified by:
      getHandlers in class org.bukkit.event.Event
    • getHandlerList

      @NotNull public static @NotNull org.bukkit.event.HandlerList getHandlerList()
      Deprecated.