CommandAPI 9.6.0
An API for the command UI introduced in Minecraft 1.13
|
Class to register commands with the 1.13 command UI. More...
Static Public Member Functions | |
static boolean | isLoaded () |
Returns whether the CommandAPI is currently loaded. More... | |
static void | stopCommandRegistration () |
Flag that commands should no longer be registered. More... | |
static boolean | canRegister () |
Determines whether command registration is permitted via the CommandAPI. More... | |
static InternalConfig | getConfiguration () |
Returns the internal configuration used to manage the CommandAPI. More... | |
static void | setLogger (CommandAPILogger logger) |
static CommandAPILogger | getLogger () |
static void | onLoad (CommandAPIConfig<?> config) |
Initializes the CommandAPI for loading. More... | |
static void | onEnable () |
Enables the CommandAPI. More... | |
static void | onDisable () |
Unloads the CommandAPI. | |
static void | logInfo (String message) |
Logs a message to the console using Logger.info() if the configuration has verbose logging enabled. More... | |
static void | logNormal (String message) |
Logs a message from the CommandAPI. More... | |
static void | logWarning (String message) |
Logs a warning from the CommandAPI. More... | |
static void | logError (String message) |
Logs an error from the CommandAPI. More... | |
static void | reloadDatapacks () |
Reloads all the datapacks that are on the server. More... | |
static< CommandSender, Player extends CommandSender > void | updateRequirements (Player player) |
Updates the requirements required for a given player to execute a command. More... | |
static WrapperCommandSyntaxException | failWithString (String message) |
Forces a command to return a success value of 0. More... | |
static WrapperCommandSyntaxException | failWithMessage (Message message) |
Forces a command to return a success value of 0. More... | |
static void | unregister (String command) |
Unregisters a command. More... | |
static void | unregister (String command, boolean unregisterNamespaces) |
Unregisters a command. More... | |
static void | registerCommand (Class<?> commandClass) |
Registers a command. More... | |
static List< RegisteredCommand > | getRegisteredCommands () |
Class to register commands with the 1.13 command UI.
|
static |
Determines whether command registration is permitted via the CommandAPI.
|
static |
Forces a command to return a success value of 0.
message | Description of the error message, formatted as a brigadier message |
WrapperCommandSyntaxException
that wraps Brigadier's CommandSyntaxException
|
static |
Forces a command to return a success value of 0.
message | Description of the error message |
WrapperCommandSyntaxException
that wraps Brigadier's CommandSyntaxException
|
static |
Returns the internal configuration used to manage the CommandAPI.
|
static |
|
static |
RegisteredCommand
s
that have been registered by the CommandAPI so far. The returned list is immutable.
|
static |
Returns whether the CommandAPI is currently loaded.
This should be true when CommandAPI#onLoad(CommandAPIConfig)
is called. If the CommandAPI is loaded, commands are available to register.
|
static |
Logs an error from the CommandAPI.
This always gets logged, even if silent logs are enabled.
message | the message to log as an error |
|
static |
Logs a message to the console using Logger.info() if the configuration has verbose logging enabled.
message | the message to log to the console |
|
static |
Logs a message from the CommandAPI.
If silent logs are enabled, this message is not logged.
message | the message to log |
|
static |
Logs a warning from the CommandAPI.
If silent logs are enabled, this warning is not logged.
message | the message to log as a warning |
|
static |
Enables the CommandAPI.
This should be placed at the start of your onEnable()
method.
|
static |
Initializes the CommandAPI for loading.
This should be placed at the start of your onLoad()
method.
config | the configuration to use for the CommandAPI. This should be a CommandAPIConfig subclass corresponding to the active platform. |
|
static |
Registers a command.
Used with the CommandAPI's Annotation API.
commandClass | the class to register |
|
static |
Reloads all the datapacks that are on the server.
This should be used if you change a datapack and want to reload a server. Execute this method after running /minecraft:reload, NOT before.
|
static |
Flag that commands should no longer be registered.
After running this, CommandAPI#canRegister()
will return false.
|
static |
Unregisters a command.
command | the name of the command to unregister |
|
static |
Unregisters a command.
command | the name of the command to unregister |
unregisterNamespaces | whether the unregistration system should attempt to remove versions of the command that start with a namespace. E.g. minecraft:command , bukkit:command , or plugin:command . If true, these namespaced versions of a command are also unregistered. |
|
static |
Updates the requirements required for a given player to execute a command.
player | the player whose requirements should be updated |