CommandAPI 9.7.0
An API for the command UI introduced in Minecraft 1.13
|
Public Member Functions | |
CommandAPICommand (CommandMetaData< CommandSender > meta) | |
CommandAPICommand (String commandName) | |
CommandAPICommand | instance () |
CommandAPICommand | withHelp (HelpTopic helpTopic) |
Sets the HelpTopic for this command. | |
void | register (String namespace) |
Registers the command with a given namespace. | |
void | register (JavaPlugin plugin) |
Registers this command with a given JavaPlugin instance. | |
boolean | isConverted () |
Returns whether this command is an automatically converted command. | |
Impl | withArguments (List< Argument > args) |
Appends the arguments to the current command builder. | |
final Impl | withArguments (Argument... args) |
Appends the argument(s) to the current command builder. | |
Impl | withOptionalArguments (List< Argument > args) |
Appends the optional arguments to the current command builder. | |
final Impl | withOptionalArguments (Argument... args) |
Appends the optional arguments to the current command builder. | |
Impl | withSubcommand (Impl subcommand) |
Adds a subcommand to this command builder. | |
Impl | withSubcommands ( @SuppressWarnings("unchecked") Impl... subcommands) |
Adds subcommands to this command builder. | |
List< Argument > | getArguments () |
Returns the list of arguments that this command has. | |
void | setArguments (List< Argument > args) |
Sets the arguments that this command has. | |
List< Impl > | getSubcommands () |
Returns the list of subcommands that this command has. | |
void | setSubcommands (List< Impl > subcommands) |
Sets the list of subcommands that this command has. | |
void | register () |
Registers this command with the default namespace. | |
Impl | copy () |
String | getName () |
Returns the name of this command. | |
Impl | withPermission (CommandPermission permission) |
Applies a permission to the current command builder. | |
Impl | withPermission (String permission) |
Applies a permission to the current command builder. | |
Impl | withoutPermission (CommandPermission permission) |
Applies a permission to the current command builder. | |
Impl | withoutPermission (String permission) |
Applies a permission to the current command builder. | |
Impl | withRequirement (Predicate< CommandSender > requirement) |
Adds a requirement that has to be satisfied to use this command. | |
Impl | withAliases (String... aliases) |
Adds an array of aliases to the current command builder. | |
CommandPermission | getPermission () |
Returns the permission associated with this command. | |
void | setPermission (CommandPermission permission) |
Sets the permission required to run this command. | |
String[] | getAliases () |
Returns an array of aliases that can be used to run this command. | |
void | setAliases (String[] aliases) |
Sets the aliases for this command. | |
Predicate< CommandSender > | getRequirements () |
Returns the requirements that must be satisfied to run this command. | |
void | setRequirements (Predicate< CommandSender > requirements) |
Sets the requirements that must be satisfied to run this command. | |
String | getShortDescription () |
Returns the short description for this command. | |
Impl | withShortDescription (String description) |
Sets the short description for this command. | |
String | getFullDescription () |
Returns the full description for this command. | |
Impl | withFullDescription (String description) |
Sets the full description for this command. | |
Impl | withUsage (String... usage) |
Sets the full usage for this command. | |
String[] | getUsage () |
Returns the usage for this command. | |
Impl | withHelp (String shortDescription, String fullDescription) |
Sets the short and full description for this command. | |
void | override () |
Overrides a command. | |
CommandAPIExecutor< CommandSender, AbstractCommandSender<? extends CommandSender > > | getExecutor () |
Returns the executors that this command has. | |
void | setExecutor (CommandAPIExecutor< CommandSender, AbstractCommandSender<? extends CommandSender > > executor) |
Sets the executors for this command. | |
Impl | clearExecutors () |
Clear all executors from the current command builder. | |
default Impl | executes (CommandExecutor executor, ExecutorType... types) |
Adds an executor to the current command builder. | |
default Impl | executes (CommandExecutionInfo executor, ExecutorType... types) |
Adds an executor to the current command builder. | |
default Impl | executes (ResultingCommandExecutor executor, ExecutorType... types) |
Adds an executor to the current command builder. | |
default Impl | executes (ResultingCommandExecutionInfo executor, ExecutorType... types) |
Adds an executor to the current command builder. | |
default Impl | executesPlayer (PlayerCommandExecutor executor) |
Adds an executor to the current command builder. | |
default Impl | executesPlayer (PlayerExecutionInfo info) |
Adds an executor to the current command builder. | |
default Impl | executesPlayer (PlayerResultingCommandExecutor executor) |
Adds an executor to the current command builder. | |
default Impl | executesPlayer (PlayerResultingExecutionInfo info) |
Adds an executor to the current command builder. | |
default Impl | executesEntity (EntityCommandExecutor executor) |
Adds an executor to the current command builder. | |
default Impl | executesEntity (EntityExecutionInfo info) |
Adds an executor to the current command builder. | |
default Impl | executesEntity (EntityResultingCommandExecutor executor) |
Adds an executor to the current command builder. | |
default Impl | executesEntity (EntityResultingExecutionInfo info) |
Adds an executor to the current command builder. | |
default Impl | executesProxy (ProxyCommandExecutor executor) |
Adds an executor to the current command builder. | |
default Impl | executesProxy (ProxyExecutionInfo info) |
Adds an executor to the current command builder. | |
default Impl | executesProxy (ProxyResultingCommandExecutor executor) |
Adds an executor to the current command builder. | |
default Impl | executesProxy (ProxyResultingExecutionInfo info) |
Adds an executor to the current command builder. | |
default Impl | executesCommandBlock (CommandBlockCommandExecutor executor) |
Adds an executor to the current command builder. | |
default Impl | executesCommandBlock (CommandBlockExecutionInfo info) |
Adds an executor to the current command builder. | |
default Impl | executesCommandBlock (CommandBlockResultingCommandExecutor executor) |
Adds an executor to the current command builder. | |
default Impl | executesCommandBlock (CommandBlockResultingExecutionInfo info) |
Adds an executor to the current command builder. | |
default Impl | executesConsole (ConsoleCommandExecutor executor) |
Adds an executor to the current command builder. | |
default Impl | executesConsole (ConsoleExecutionInfo info) |
Adds an executor to the current command builder. | |
default Impl | executesConsole (ConsoleResultingCommandExecutor executor) |
Adds an executor to the current command builder. | |
default Impl | executesConsole (ConsoleResultingExecutionInfo info) |
Adds an executor to the current command builder. | |
default Impl | executesNative (NativeCommandExecutor executor) |
Adds an executor to the current command builder. | |
default Impl | executesNative (NativeExecutionInfo info) |
Adds an executor to the current command builder. | |
default Impl | executesNative (NativeResultingCommandExecutor executor) |
Adds an executor to the current command builder. | |
default Impl | executesNative (NativeResultingExecutionInfo info) |
Adds an executor to the current command builder. | |
default Impl | executesRemoteConsole (RemoteConsoleCommandExecutor executor) |
Adds an executor to the current command builder. | |
default Impl | executesRemoteConsole (RemoteConsoleExecutionInfo info) |
Adds an executor to the current command builder. | |
default Impl | executesRemoteConsole (RemoteConsoleResultingCommandExecutor executor) |
Adds an executor to the current command builder. | |
default Impl | executesRemoteConsole (RemoteConsoleResultingExecutionInfo info) |
Adds an executor to the current command builder. | |
default Impl | executesFeedbackForwarding (FeedbackForwardingCommandExecutor executor) |
Adds an executor to the current command builder. | |
default Impl | executesFeedbackForwarding (FeedbackForwardingExecutionInfo info) |
Adds an executor to the current command builder. | |
default Impl | executesFeedbackForwarding (FeedbackForwardingResultingCommandExecutor executor) |
Adds an executor to the current command builder. | |
default Impl | executesFeedbackForwarding (FeedbackForwardingResultingExecutionInfo info) |
Adds an executor to the current command builder. | |
Protected Member Functions | |
CommandAPICommand | newConcreteCommandAPICommand (CommandMetaData< CommandSender > metaData) |
Protected Attributes | |
List< Argument > | arguments |
List< Impl > | subcommands |
boolean | isConverted |
final CommandMetaData< CommandSender > | meta |
The Command's meta-data for this executable command. | |
CommandAPIExecutor< CommandSender, AbstractCommandSender<? extends CommandSender > > | executor |
The CommandAPIExecutor for this executable implementation. | |
|
inherited |
Clear all executors from the current command builder.
|
inherited |
Adds an executor to the current command builder.
executor | A lambda of type (BukkitCommandExecutionInfo) -> () that will be executed when the command is run |
types | A list of executor types to use this executes method for. |
|
inherited |
Adds an executor to the current command builder.
executor | A lambda of type (CommandSender, Object[]) -> () that will be executed when the command is run |
types | A list of executor types to use this executes method for. |
|
inherited |
Adds an executor to the current command builder.
executor | A lambda of type (BukkitCommandExecutionInfo) -> int that will be executed when the command is run |
types | A list of executor types to use this executes method for. |
|
inherited |
Adds an executor to the current command builder.
executor | A lambda of type (CommandSender, CommandArguments) -> int that will be executed when the command is run |
types | A list of executor types to use this executes method for. |
|
inherited |
Adds an executor to the current command builder.
executor | A lambda of type (BlockCommandSender, CommandArguments) -> () that will be executed when the command is run |
|
inherited |
Adds an executor to the current command builder.
info | A lambda of type (ExecutionInfo) -> () that will be executed when the command is run |
|
inherited |
Adds an executor to the current command builder.
executor | A lambda of type (BlockCommandSender, CommandArguments) -> int that will be executed when the command is run |
|
inherited |
Adds an executor to the current command builder.
info | A lambda of type (ExecutionInfo) -> int that will be executed when the command is run |
|
inherited |
Adds an executor to the current command builder.
executor | A lambda of type (ConsoleCommandSender, CommandArguments) -> () that will be executed when the command is run |
|
inherited |
Adds an executor to the current command builder.
info | A lambda of type (ExecutionInfo) -> () that will be executed when the command is run |
|
inherited |
Adds an executor to the current command builder.
executor | A lambda of type (ConsoleCommandSender, CommandArguments) -> int that will be executed when the command is run |
|
inherited |
Adds an executor to the current command builder.
info | A lambda of type (ExecutionInfo) -> int that will be executed when the command is run |
|
inherited |
Adds an executor to the current command builder.
executor | A lambda of type (Entity, CommandArguments) -> () that will be executed when the command is run |
|
inherited |
Adds an executor to the current command builder.
info | A lambda of type (ExecutionInfo) -> () that will be executed when the command is run |
|
inherited |
Adds an executor to the current command builder.
executor | A lambda of type (Entity, CommandArguments) -> int that will be executed when the command is run |
|
inherited |
Adds an executor to the current command builder.
info | A lambda of type (ExecutionInfo) -> int that will be executed when the command is run |
|
inherited |
Adds an executor to the current command builder.
executor | A lambda of type (FeedbackForwardingCommandExecutor, CommandArguments) -> () that will be executed when the command is run |
|
inherited |
Adds an executor to the current command builder.
info | A lambda of type (ExecutionInfo) -> () that will be executed when the command is run |
|
inherited |
Adds an executor to the current command builder.
executor | A lambda of type (FeedbackForwardingCommandExecutor, CommandArguments) -> int that will be executed when the command is run |
|
inherited |
Adds an executor to the current command builder.
info | A lambda of type (ExecutionInfo) -> int that will be executed when the command is run |
|
inherited |
Adds an executor to the current command builder.
executor | A lambda of type (NativeCommandExecutor, CommandArguments) -> () that will be executed when the command is run |
|
inherited |
Adds an executor to the current command builder.
info | A lambda of type (ExecutionInfo) -> () that will be executed when the command is run |
|
inherited |
Adds an executor to the current command builder.
executor | A lambda of type (NativeCommandExecutor, CommandArguments) -> int that will be executed when the command is run |
|
inherited |
Adds an executor to the current command builder.
info | A lambda of type (ExecutionInfo) -> int that will be executed when the command is run |
|
inherited |
Adds an executor to the current command builder.
executor | A lambda of type (Player, CommandArguments) -> () that will be executed when the command is run |
|
inherited |
Adds an executor to the current command builder.
info | A lambda of type (ExecutionInfo) -> () that will be executed when the command is run |
|
inherited |
Adds an executor to the current command builder.
executor | A lambda of type (Player, CommandArguments) -> int that will be executed when the command is run |
|
inherited |
Adds an executor to the current command builder.
info | A lambda of type (ExecutionInfo) -> int that will be executed when the command is run |
|
inherited |
Adds an executor to the current command builder.
executor | A lambda of type (Entity, CommandArguments) -> () that will be executed when the command is run |
|
inherited |
Adds an executor to the current command builder.
info | A lambda of type (ExecutionInfo) -> () that will be executed when the command is run |
|
inherited |
Adds an executor to the current command builder.
executor | A lambda of type (Entity, CommandArguments) -> int that will be executed when the command is run |
|
inherited |
Adds an executor to the current command builder.
info | A lambda of type (ExecutionInfo) -> int that will be executed when the command is run |
|
inherited |
Adds an executor to the current command builder.
executor | A lambda of type (RemoteConsoleCommandExecutor, CommandArguments) -> () that will be executed when the command is run |
|
inherited |
Adds an executor to the current command builder.
info | A lambda of type (ExecutionInfo) -> () that will be executed when the command is run |
|
inherited |
Adds an executor to the current command builder.
executor | A lambda of type (RemoteConsoleResultingCommandExecutor, CommandArguments) -> int that will be executed when the command is run |
|
inherited |
Adds an executor to the current command builder.
info | A lambda of type (ExecutionInfo) -> int that will be executed when the command is run |
|
inherited |
Returns an array of aliases that can be used to run this command.
|
inherited |
Returns the list of arguments that this command has.
|
inherited |
Returns the executors that this command has.
|
inherited |
Returns the full description for this command.
|
inherited |
Returns the name of this command.
|
inherited |
Returns the permission associated with this command.
|
inherited |
Returns the requirements that must be satisfied to run this command.
|
inherited |
Returns the short description for this command.
|
inherited |
Returns the list of subcommands that this command has.
|
inherited |
Returns the usage for this command.
|
inherited |
Returns whether this command is an automatically converted command.
|
inherited |
Overrides a command.
Effectively the same as unregistering the command using CommandAPI.unregister() and then registering the command using .register()
void dev.jorel.commandapi.CommandAPICommand.register | ( | JavaPlugin | plugin | ) |
Registers this command with a given JavaPlugin
instance.
plugin | The plugin instance used to determine this command's namespace |
void dev.jorel.commandapi.CommandAPICommand.register | ( | String | namespace | ) |
Registers the command with a given namespace.
namespace | The namespace of this command. This cannot be null or empty |
|
inherited |
Sets the aliases for this command.
aliases | the aliases for this command |
|
inherited |
Sets the arguments that this command has.
args | the arguments that this command has |
|
inherited |
Sets the executors for this command.
executor | the executors for this command |
|
inherited |
Sets the permission required to run this command.
permission | the permission required to run this command |
|
inherited |
Sets the requirements that must be satisfied to run this command.
requirements | the requirements that must be satisfied to run this command |
|
inherited |
Sets the list of subcommands that this command has.
subcommands | the list of subcommands that this command has |
|
inherited |
Adds an array of aliases to the current command builder.
aliases | An array of aliases which can be used to execute this command |
|
inherited |
Appends the argument(s) to the current command builder.
args | Arguments that this command can accept |
|
inherited |
Appends the arguments to the current command builder.
args | A List that represents the arguments that this command can accept |
|
inherited |
Sets the full description for this command.
This is the help which is shown in the specific /help page for this command (e.g. /help mycommand).
description | the full description for this command |
|
inherited |
Sets the short and full description for this command.
This is a short-hand for the ExecutableCommand#withShortDescription
and ExecutableCommand#withFullDescription
methods.
shortDescription | the short description for this command |
fullDescription | the full description for this command |
CommandAPICommand dev.jorel.commandapi.CommandAPICommand.withHelp | ( | HelpTopic | helpTopic | ) |
Sets the HelpTopic
for this command.
Using this method will override any declared short description, full description or usage description provided via the following methods:
CommandAPICommand#withShortDescription(String)
CommandAPICommand#withFullDescription(String)
CommandAPICommand#withUsage(String...)
CommandAPICommand#withHelp(String, String)
helpTopic | the help topic to use for this command |
|
inherited |
Appends the optional arguments to the current command builder.
This also calls AbstractArgument#setOptional(boolean)
on each argument to make sure they are optional
args | Arguments that this command can accept |
|
inherited |
Appends the optional arguments to the current command builder.
This also calls AbstractArgument#setOptional(boolean)
on each argument to make sure they are optional
args | A List that represents the arguments that this command can accept |
|
inherited |
Applies a permission to the current command builder.
permission | The permission node required to execute this command |
|
inherited |
Applies a permission to the current command builder.
permission | The permission node required to execute this command |
|
inherited |
Applies a permission to the current command builder.
permission | The permission node required to execute this command |
|
inherited |
Applies a permission to the current command builder.
permission | The permission node required to execute this command |
|
inherited |
Adds a requirement that has to be satisfied to use this command.
This method can be used multiple times and each use of this method will AND its requirement with the previously declared ones
requirement | the predicate that must be satisfied to use this command |
|
inherited |
Sets the short description for this command.
This is the help which is shown in the main /help menu.
description | the short description for this command |
|
inherited |
Adds a subcommand to this command builder.
subcommand | the subcommand to add as a child of this command |
|
inherited |
Adds subcommands to this command builder.
subcommands | the subcommands to add as children of this command |
|
inherited |
Sets the full usage for this command.
This is the usage which is shown in the specific /help page for this command (e.g. /help mycommand).
usage | the full usage for this command |