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
ConstructorsConstructorDescriptionCommandRegisteredEvent(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 TypeMethodDescriptionDeprecated.org.bukkit.command.CommandDeprecated.Deprecated.Deprecated.Returns the Bukkit API's default handling of Arguments, if you wish to reuse it.static @NotNull org.bukkit.event.HandlerListDeprecated.@NotNull org.bukkit.event.HandlerListDeprecated.com.mojang.brigadier.tree.LiteralCommandNode<S>Deprecated.Returns the Bukkit API's default literal for this command, including thegetDefaultArgs()as a child already.com.mojang.brigadier.tree.RootCommandNode<S>getRoot()Deprecated.booleanDeprecated.voidsetCancelled(boolean cancel) Deprecated.Cancels registering this command to Brigadier, but will remain in Bukkit Command Map.voidsetLiteral(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
-
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
Deprecated.- Returns:
- The command name being registered
-
getBrigadierCommand
Deprecated.- Returns:
- The Bukkit API Brigadier Wrapped Command Object to handle executions and suggestions
-
getCommand
public org.bukkit.command.Command getCommand()Deprecated. -
getRoot
Deprecated.- Returns:
- Gets the root command node being used to register a command to.
-
getDefaultArgs
Deprecated.Returns the Bukkit API's default handling of Arguments, if you wish to reuse it.- Returns:
-
getLiteral
Deprecated.Returns the Bukkit API's default literal for this command, including thegetDefaultArgs()as a child already.- Returns:
-
setLiteral
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:
isCancelledin interfaceorg.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:
setCancelledin interfaceorg.bukkit.event.Cancellable
-
getHandlers
@NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()Deprecated.- Specified by:
getHandlersin classorg.bukkit.event.Event
-
getHandlerList
@NotNull public static @NotNull org.bukkit.event.HandlerList getHandlerList()Deprecated.
-