CommandAPI 9.6.0
An API for the command UI introduced in Minecraft 1.13
|
The core abstract class for Command API arguments. More...
Public Member Functions | |
Argument< T > | instance () |
Returns the instance of this class with the class Impl. More... | |
boolean | isListed () |
Returns true if this argument will be listed in the Object args[] of the command executor. More... | |
boolean | isOptional () |
Returns true if this argument will be optional when executing the command this argument is included in. More... | |
abstract Class< T > | getPrimitiveType () |
Returns the primitive type of the current Argument. More... | |
abstract CommandAPIArgumentType | getArgumentType () |
Returns the argument type for this argument. More... | |
final ArgumentType<?> | getRawType () |
Returns the NMS or brigadier type for this argument. More... | |
final String | getNodeName () |
Returns the name of this argument's node. More... | |
abstract< Source > T | parseArgument (CommandContext< Source > cmdCtx, String key, CommandArguments previousArgs) throws CommandSyntaxException |
Parses an argument, returning the specific Bukkit object that the argument represents. More... | |
Impl | includeSuggestions (ArgumentSuggestions< CommandSender > suggestions) |
Include suggestions to add to the list of default suggestions represented by this argument. More... | |
Optional< ArgumentSuggestions< CommandSender > > | getIncludedSuggestions () |
Returns an optional function which produces an array of suggestions which should be added to existing suggestions. More... | |
Impl | replaceSuggestions (ArgumentSuggestions< CommandSender > suggestions) |
Replace the suggestions of this argument. More... | |
final Optional< ArgumentSuggestions< CommandSender > > | getOverriddenSuggestions () |
Returns an optional function that maps the command sender to an IStringTooltip array of suggestions for the current command. More... | |
final Impl | withPermission (CommandPermission permission) |
Assigns the given permission as a requirement to execute this command. More... | |
final Impl | withPermission (String permission) |
Assigns the given permission as a requirement to execute this command. More... | |
final CommandPermission | getArgumentPermission () |
Returns the permission required to run this command. More... | |
final Predicate< CommandSender > | getRequirements () |
Returns the requirements required to run this command. More... | |
final Impl | withRequirement (Predicate< CommandSender > requirement) |
Adds a requirement that has to be satisfied to use this argument. More... | |
Impl | setListed (boolean listed) |
Sets whether this argument will be listed in the Object args[] of the command executor. More... | |
Impl | setOptional (boolean optional) |
Sets whether this argument will be optional when executing the command this argument is included in. More... | |
List< Argument > | getCombinedArguments () |
Returns a list of arguments linked to this argument. More... | |
boolean | hasCombinedArguments () |
Returns true if this argument has linked arguments. More... | |
final Impl | combineWith (Argument... combinedArguments) |
Adds combined arguments to this argument. More... | |
List< String > | getEntityNames (Object argument) |
Gets a list of entity names for the current provided argument. More... | |
void | copyPermissionsAndRequirements (Argument argument) |
Copies permissions and requirements from the provided argument to this argument This also resets additional permissions and requirements. More... | |
String | getHelpString () |
String | toString () |
default Impl | executes (CommandExecutor executor, ExecutorType... types) |
Adds an executor to the current command builder. More... | |
default Impl | executes (CommandExecutionInfo executor, ExecutorType... types) |
Adds an executor to the current command builder. More... | |
default Impl | executes (ResultingCommandExecutor executor, ExecutorType... types) |
Adds an executor to the current command builder. More... | |
default Impl | executes (ResultingCommandExecutionInfo executor, ExecutorType... types) |
Adds an executor to the current command builder. More... | |
default Impl | executesPlayer (PlayerCommandExecutor executor) |
Adds an executor to the current command builder. More... | |
default Impl | executesPlayer (PlayerExecutionInfo info) |
Adds an executor to the current command builder. More... | |
default Impl | executesPlayer (PlayerResultingCommandExecutor executor) |
Adds an executor to the current command builder. More... | |
default Impl | executesPlayer (PlayerResultingExecutionInfo info) |
Adds an executor to the current command builder. More... | |
default Impl | executesEntity (EntityCommandExecutor executor) |
Adds an executor to the current command builder. More... | |
default Impl | executesEntity (EntityExecutionInfo info) |
Adds an executor to the current command builder. More... | |
default Impl | executesEntity (EntityResultingCommandExecutor executor) |
Adds an executor to the current command builder. More... | |
default Impl | executesEntity (EntityResultingExecutionInfo info) |
Adds an executor to the current command builder. More... | |
default Impl | executesProxy (ProxyCommandExecutor executor) |
Adds an executor to the current command builder. More... | |
default Impl | executesProxy (ProxyExecutionInfo info) |
Adds an executor to the current command builder. More... | |
default Impl | executesProxy (ProxyResultingCommandExecutor executor) |
Adds an executor to the current command builder. More... | |
default Impl | executesProxy (ProxyResultingExecutionInfo info) |
Adds an executor to the current command builder. More... | |
default Impl | executesCommandBlock (CommandBlockCommandExecutor executor) |
Adds an executor to the current command builder. More... | |
default Impl | executesCommandBlock (CommandBlockExecutionInfo info) |
Adds an executor to the current command builder. More... | |
default Impl | executesCommandBlock (CommandBlockResultingCommandExecutor executor) |
Adds an executor to the current command builder. More... | |
default Impl | executesCommandBlock (CommandBlockResultingExecutionInfo info) |
Adds an executor to the current command builder. More... | |
default Impl | executesConsole (ConsoleCommandExecutor executor) |
Adds an executor to the current command builder. More... | |
default Impl | executesConsole (ConsoleExecutionInfo info) |
Adds an executor to the current command builder. More... | |
default Impl | executesConsole (ConsoleResultingCommandExecutor executor) |
Adds an executor to the current command builder. More... | |
default Impl | executesConsole (ConsoleResultingExecutionInfo info) |
Adds an executor to the current command builder. More... | |
default Impl | executesNative (NativeCommandExecutor executor) |
Adds an executor to the current command builder. More... | |
default Impl | executesNative (NativeExecutionInfo info) |
Adds an executor to the current command builder. More... | |
default Impl | executesNative (NativeResultingCommandExecutor executor) |
Adds an executor to the current command builder. More... | |
default Impl | executesNative (NativeResultingExecutionInfo info) |
Adds an executor to the current command builder. More... | |
default Impl | executesRemoteConsole (RemoteConsoleCommandExecutor executor) |
Adds an executor to the current command builder. More... | |
default Impl | executesRemoteConsole (RemoteConsoleExecutionInfo info) |
Adds an executor to the current command builder. More... | |
default Impl | executesRemoteConsole (RemoteConsoleResultingCommandExecutor executor) |
Adds an executor to the current command builder. More... | |
default Impl | executesRemoteConsole (RemoteConsoleResultingExecutionInfo info) |
Adds an executor to the current command builder. More... | |
default Impl | executesFeedbackForwarding (FeedbackForwardingCommandExecutor executor) |
Adds an executor to the current command builder. More... | |
default Impl | executesFeedbackForwarding (FeedbackForwardingExecutionInfo info) |
Adds an executor to the current command builder. More... | |
default Impl | executesFeedbackForwarding (FeedbackForwardingResultingCommandExecutor executor) |
Adds an executor to the current command builder. More... | |
default Impl | executesFeedbackForwarding (FeedbackForwardingResultingExecutionInfo info) |
Adds an executor to the current command builder. More... | |
CommandAPIExecutor< CommandSender, AbstractCommandSender<? extends CommandSender > > | getExecutor () |
Protected Member Functions | |
Argument (String nodeName, ArgumentType<?> rawType) | |
Constructs an argument with a given NMS/brigadier type. More... | |
The core abstract class for Command API arguments.
<T> | The type of the underlying object that this argument casts to |
|
protected |
Constructs an argument with a given NMS/brigadier type.
nodeName | the name to assign to this argument node |
rawType | the NMS or brigadier type to be used for this argument |
|
inherited |
Adds combined arguments to this argument.
Combined arguments are used to have required arguments after optional arguments by ignoring they exist until they are added to the arguments array for registration.
This method also causes permissions and requirements from this argument to be copied over to the arguments you want to combine this argument with. Their permissions and requirements will be ignored.
combinedArguments | The arguments to combine to this argument |
|
inherited |
Copies permissions and requirements from the provided argument to this argument This also resets additional permissions and requirements.
argument | The argument to copy permissions and requirements from |
|
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 the permission required to run this command.
|
abstractinherited |
Returns the argument type for this argument.
|
inherited |
Returns a list of arguments linked to this argument.
|
inherited |
Gets a list of entity names for the current provided argument.
This is expected to be implemented by EntitySelectorArgument
in Bukkit, see EntitySelectorArgument#getEntityNames(Object)
argument | a parsed (Bukkit) object representing the entity selector type. This is either a List, an Entity or a Player |
argument
|
inherited |
Returns an optional function which produces an array of suggestions which should be added to existing suggestions.
|
inherited |
Returns the name of this argument's node.
|
inherited |
Returns an optional function that maps the command sender to an IStringTooltip array of suggestions for the current command.
Optional.empty()
if there are no overridden suggestions.
|
abstractinherited |
Returns the primitive type of the current Argument.
After executing a command, this argument should yield an object of this returned class.
|
inherited |
Returns the NMS or brigadier type for this argument.
|
inherited |
Returns the requirements required to run this command.
|
inherited |
Returns true if this argument has linked arguments.
|
inherited |
Include suggestions to add to the list of default suggestions represented by this argument.
suggestions | An ArgumentSuggestions object representing the suggestions. Use the Static methods on ArgumentSuggestions to create these. |
Argument< T > dev.jorel.commandapi.arguments.Argument< T >.instance | ( | ) |
Returns the instance of this class with the class Impl.
Used for chaining builder methods.
Implements dev.jorel.commandapi.ChainableBuilder< Impl >.
|
inherited |
Returns true if this argument will be listed in the Object args[] of the command executor.
|
inherited |
Returns true if this argument will be optional when executing the command this argument is included in.
|
abstractinherited |
Parses an argument, returning the specific Bukkit object that the argument represents.
This is intended for use by the internals of the CommandAPI and isn't expected to be used outside the CommandAPI
<Source> | the command source type |
cmdCtx | the context which ran this command |
key | the name of the argument node |
previousArgs | a CommandArguments object holding previous parsed arguments |
CommandSyntaxException | if parsing fails |
|
inherited |
Replace the suggestions of this argument.
suggestions | An ArgumentSuggestions object representing the suggestions. Use the static methods in ArgumentSuggestions to create these. |
|
inherited |
Sets whether this argument will be listed in the Object args[] of the command executor.
listed | if true, this argument will be included in the Object args[] of the command executor |
|
inherited |
Sets whether this argument will be optional when executing the command this argument is included in.
optional | if true, this argument will be optional when executing the command this argument is included in |
|
inherited |
Assigns the given permission as a requirement to execute this command.
permission | the permission required to execute this command |
|
inherited |
Assigns the given permission as a requirement to execute this command.
permission | the permission required to execute this command |
|
inherited |
Adds a requirement that has to be satisfied to use this argument.
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 argument |