CommandAPI 9.7.0
An API for the command UI introduced in Minecraft 1.13
|
Classes relating to the different FunctionalInterfaces for command execution. More...
Classes | |
interface | CommandBlockCommandExecutor |
A normal command executor for a BlockCommandSender. More... | |
interface | CommandBlockExecutionInfo |
interface | CommandBlockResultingCommandExecutor |
A resulting command executor for a BlockCommandSender. More... | |
interface | CommandBlockResultingExecutionInfo |
interface | CommandExecutionInfo |
interface | CommandExecutor |
A normal command executor for a CommandSender. More... | |
interface | ConsoleCommandExecutor |
A normal command executor for a ConsoleCommandSender. More... | |
interface | ConsoleExecutionInfo |
interface | ConsoleResultingCommandExecutor |
A resulting command executor for a ConsoleCommandSender. More... | |
interface | ConsoleResultingExecutionInfo |
interface | EntityCommandExecutor |
A normal command executor for an Entity. More... | |
interface | EntityExecutionInfo |
interface | EntityResultingCommandExecutor |
A resulting command executor for an Entity. More... | |
interface | EntityResultingExecutionInfo |
interface | ExecutionInfo |
This interface represents an ExecutionInfo for a command. More... | |
enum | ExecutorType |
An enum representing the type of an executor. More... | |
interface | FeedbackForwardingCommandExecutor |
A normal command executor for a BlockCommandSender. More... | |
interface | FeedbackForwardingExecutionInfo |
interface | FeedbackForwardingResultingCommandExecutor |
A resulting command executor for a BlockCommandSender. More... | |
interface | FeedbackForwardingResultingExecutionInfo |
interface | NativeCommandExecutor |
A normal command executor for a NativeProxyCommandSender. More... | |
interface | NativeExecutionInfo |
interface | NativeResultingCommandExecutor |
A resulting command executor for a NativeProxyCommandSender. More... | |
interface | NativeResultingExecutionInfo |
interface | NormalExecutor |
The interface for normal command executors. More... | |
interface | PlayerCommandExecutor |
A normal command executor for a Player. More... | |
interface | PlayerExecutionInfo |
interface | PlayerResultingCommandExecutor |
A resulting command executor for a Player. More... | |
interface | PlayerResultingExecutionInfo |
interface | ProxyCommandExecutor |
A normal command executor for a NativeProxyCommandSender. More... | |
interface | ProxyExecutionInfo |
interface | ProxyResultingCommandExecutor |
A resulting command executor for a NativeProxyCommandSender. More... | |
interface | ProxyResultingExecutionInfo |
interface | RemoteConsoleCommandExecutor |
interface | RemoteConsoleExecutionInfo |
interface | RemoteConsoleResultingCommandExecutor |
interface | RemoteConsoleResultingExecutionInfo |
interface | ResultingCommandExecutionInfo |
interface | ResultingCommandExecutor |
A resulting command executor for a CommandSender. More... | |
interface | ResultingExecutor |
The interface for resulting command executors. More... | |
interface | TypedExecutor |
An interface that includes the type of an executor (what command senders it can execute) and has a method that executes an executor with a given command sender and arguments. More... | |
Functions | |
record | CommandArguments (Object[] args, Map< String, Object > argsMap, String[] rawArgs, Map< String, String > rawArgsMap, String fullInput) |
This class stores the arguments for this command. More... | |
record | BukkitExecutionInfo< Sender > (Sender sender, BukkitCommandSender<? extends Sender > senderWrapper, CommandArguments args) implements ExecutionInfo< Sender |
This record represents a BukkitExecutionInfo for a command. More... | |
Classes relating to the different FunctionalInterfaces for command execution.
record dev.jorel.commandapi.executors.BukkitExecutionInfo< Sender > | ( | Sender | sender, |
BukkitCommandSender<? extends Sender > | senderWrapper, | ||
CommandArguments | args | ||
) |
This record represents a BukkitExecutionInfo for a command.
It provides the sender of a command, as well as it's arguments
<Sender> | The type of the sender of a command this BukkitExecutionInfo belongs to |
sender |
senderWrapper | This is not intended for public use and is only used internally. The BukkitExecutionInfo#sender() method should be used instead! |
args |
record dev.jorel.commandapi.executors.CommandArguments | ( | Object[] | args, |
Map< String, Object > | argsMap, | ||
String[] | rawArgs, | ||
Map< String, String > | rawArgsMap, | ||
String | fullInput | ||
) |
This class stores the arguments for this command.
args | The arguments for this command |
argsMap | The arguments for this command mapped to their node names. This is an ordered map |
rawArgs | The raw arguments for this command. |
rawArgsMap | The raw arguments for this command mapped to their node names. This is an ordered map |
fullInput | The command string a player has entered (including the /) |
This returns the raw command string a player has entered
CommandArguments#fullInput()
Returns an argument by its position
index | The position of this argument |
null
if the provided index does not point to an argument.Returns an argument by its node name
nodeName | The node name of this argument. This was set when initializing an argument |
null
if nodeName
was not found.Returns an argument by its index
index | The position of this argument |
defaultValue | The Object returned if the argument is not existent |
Returns an argument by its node name
nodeName | The node name of this argument. This was set when initializing an argument |
defaultValue | The Object returned if the argument was not found. |
Returns an argument by its index
index | The position of this argument |
defaultValue | The Object returned if the argument is not existent |
Returns an argument by its node name
nodeName | The node name of this argument. This was set when initializing an argument |
defaultValue | The Object returned if the argument was not found. |
Returns an Optional
holding the argument by its index
index | The position of this argument |
Returns an argument by its node name
nodeName | The node name of this argument. This was set when initializing an argument |
Returns a raw argument by its position
A raw argument is the String
form of an argument as written in a command. For example take this command:
/mycommand @e 15.3
When using this method to access these arguments, @e
and 15.3
will be available as String
s and not as a Collection
and Double
index | The position of this argument |
null
if the provided index does not point to an argument.Returns a raw argument by its node name
A raw argument is the String
form of an argument as written in a command. For example take this command:
/mycommand @e 15.3
When using this method to access these arguments, @e
and 15.3
will be available as String
s and not as a Collection
and Double
nodeName | The node name of this argument. This was set when initializing an argument |
null
if nodeName
was not found.Returns a raw argument by its index
A raw argument is the String
form of an argument as written in a command. For example take this command:
/mycommand @e 15.3
When using this method to access these arguments, @e
and 15.3
will be available as String
s and not as a Collection
and Double
index | The position of this argument |
defaultValue | The String returned if the raw argument is not existent |
Returns a raw argument by its node name
A raw argument is the String
form of an argument as written in a command. For example take this command:
/mycommand @e 15.3
When using this method to access these arguments, @e
and 15.3
will be available as String
s and not as a Collection
and Double
nodeName | The node name of this argument. This was set when initializing an argument |
defaultValue | The String returned if the raw argument was not found. |
Returns a raw argument by its index
A raw argument is the String
form of an argument as written in a command. For example take this command:
/mycommand @e 15.3
When using this method to access these arguments, @e
and 15.3
will be available as String
s and not as a Collection
and Double
index | The position of this argument |
defaultValue | The String returned if the raw argument is not existent |
Returns a raw argument by its node name
A raw argument is the String
form of an argument as written in a command. For example take this command:
/mycommand @e 15.3
When using this method to access these arguments, @e
and 15.3
will be available as String
s and not as a Collection
and Double
nodeName | The node name of this raw argument. This was set when initializing an argument |
defaultValue | The String returned if the raw argument was not found. |
Returns an Optional
holding the raw argument by its index
A raw argument is the String
form of an argument as written in a command. For example take this command:
/mycommand @e 15.3
When using this method to access these arguments, @e
and 15.3
will be available as String
s and not as a Collection
and Double
index | The position of this argument |
Returns an Optional
holding the raw argument by its node name
A raw argument is the String
form of an argument as written in a command. For example take this command:
/mycommand @e 15.3
When using this method to access these arguments, @e
and 15.3
will be available as String
s and not as a Collection
and Double
nodeName | The node name of this argument. This was set when initializing an argument |
Unchecked methods. These are the same as the methods above, but use unchecked generics to conform to the type they are declared as. In Java, the normal methods (checked) require casting:
CommandArguments args = ...; String myString = (String) args.get("target");
However, these unchecked methods don't require casting:
CommandArguments args = ...; String myString = args.getUnchecked("target");
Returns an argument by its position
index | The position of this argument |
null
if the provided index does not point to an argument.Returns an argument by its node name
nodeName | The node name of this argument. This was set when initializing an argument |
nodeName
was not found.Returns an argument by its index
index | The position of this argument |
defaultValue | The Object returned if the argument is not existent |
Returns an argument by its node name
nodeName | The node name of this argument. This was set when initializing an argument |
defaultValue | The Object returned if the argument was not found. |
Returns an argument by its index
index | The position of this argument |
defaultValue | The Object returned if the argument is not existent |
Returns an argument by its node name
nodeName | The node name of this argument. This was set when initializing an argument |
defaultValue | The Object returned if the argument was not found. |
Returns an Optional
holding the argument at its index
index | The position of this argument |
Returns an Optional
holding the argument by its node name
nodeName | The node name of this argument. This was set when initializing an argument |
Returns an argument purely based on its CommandAPI representation. This also attempts to directly cast the argument to the type represented by dev.jorel.commandapi.arguments.AbstractArgument#getPrimitiveType()
argumentType | The argument instance used to create the argument |
Returns an argument purely based on its CommandAPI representation or a default value if the argument wasn't found.
If the argument was found, this also attempts to directly cast the argument to the type represented by dev.jorel.commandapi.arguments.AbstractArgument#getPrimitiveType()
argumentType | The argument instance used to create the argument |
defaultValue | The default value to return if the argument wasn't found |
Returns an Optional
holding the provided argument. This Optional
can be empty if the argument was not given when running the command.
This attempts to directly cast the argument to the type represented by dev.jorel.commandapi.arguments.AbstractArgument#getPrimitiveType()
argumentType | The argument instance used to create the argument |
Optional
holding the argument, or an empty Optional
if the argument was not found.Returns an argument based on its node name. This also attempts to directly cast the argument to the type represented by the argumentType
parameter.
nodeName | The node name of the argument |
argumentType | The class that represents the argument |
Returns an argument based on its node name or a default value if the argument wasn't found.
If the argument was found, this method attempts to directly cast the argument to the type represented by the argumentType
parameter.
nodeName | The node name of the argument |
argumentType | The class that represents the argument |
defaultValue | The default value to return if the argument wasn't found |
Returns an Optional
holding the argument with the given node name. This Optional
can be empty if the argument was not given when running the command.
This attempts to directly cast the argument to the type represented by the argumentType
parameter.
nodeName | The node name of the argument |
argumentType | The class that represents the argument |
Optional
holding the argument, or an empty Optional
if the argument was not found.Returns an argument based on its index. This also attempts to directly cast the argument to the type represented by the argumentType
parameter.
index | The index of the argument |
argumentType | The class that represents the argument |
Returns an argument based on its index or a default value if the argument wasn't found.
If the argument was found, this method attempts to directly cast the argument to the type represented by the argumentType
parameter.
index | The index of the argument |
argumentType | The class that represents the argument |
defaultValue | The default value to return if the argument wasn't found |
Returns an Optional
holding the argument at the given index. This Optional
can be empty if the argument was not given when running the command.
This attempts to directly cast the argument to the type represented by the argumentType
parameter.
index | The index of the argument |
argumentType | The class that represents the argument |
Optional
holding the argument, or an empty Optional
if the argument was not found.args | |
The | arguments for this command |
argsMap | |
The | arguments for this command mapped to their node names. This is an ordered map |
rawArgs | |
The | raw arguments for this command |
rawArgsMap | |
The | raw arguments for this command mapped to their node names. This is an ordered map |
fullInput | |
The | command string a player has entered (including the /) |