CommandAPI 9.7.0
An API for the command UI introduced in Minecraft 1.13
dev.jorel.commandapi.CommandTree Class Reference
+ Inheritance diagram for dev.jorel.commandapi.CommandTree:

Public Member Functions

 CommandTree (String commandName)
 Creates a main root node for a command tree with a given command name. More...
 
CommandTree instance ()
 
void register (String namespace)
 Registers the command with a given namespace. More...
 
void register (JavaPlugin plugin)
 Registers this command with a given JavaPlugin instance. More...
 
Impl then (final AbstractArgumentTree<?, Argument, CommandSender > tree)
 Create a child branch on the tree. More...
 
final Impl thenNested (List< AbstractArgumentTree<?, Argument, CommandSender > > trees)
 Creates a chain of child branches starting at this node. More...
 
final Impl thenNested (final AbstractArgumentTree<?, Argument, CommandSender >... trees)
 Creates a chain of child branches starting at this node. More...
 
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...
 

Constructor & Destructor Documentation

◆ CommandTree()

dev.jorel.commandapi.CommandTree.CommandTree ( String  commandName)

Creates a main root node for a command tree with a given command name.

Parameters
commandNameThe name of the command to create

Member Function Documentation

◆ executes() [1/4]

default Impl dev.jorel.commandapi.BukkitExecutable< Impl >.executes ( CommandExecutionInfo  executor,
ExecutorType...  types 
)
inherited

Adds an executor to the current command builder.

Parameters
executorA lambda of type (BukkitCommandExecutionInfo) -> () that will be executed when the command is run
typesA list of executor types to use this executes method for.
Returns
this command builder

◆ executes() [2/4]

default Impl dev.jorel.commandapi.BukkitExecutable< Impl >.executes ( CommandExecutor  executor,
ExecutorType...  types 
)
inherited

Adds an executor to the current command builder.

Parameters
executorA lambda of type (CommandSender, Object[]) -> () that will be executed when the command is run
typesA list of executor types to use this executes method for.
Returns
this command builder

◆ executes() [3/4]

default Impl dev.jorel.commandapi.BukkitExecutable< Impl >.executes ( ResultingCommandExecutionInfo  executor,
ExecutorType...  types 
)
inherited

Adds an executor to the current command builder.

Parameters
executorA lambda of type (BukkitCommandExecutionInfo) -> int that will be executed when the command is run
typesA list of executor types to use this executes method for.
Returns
this command builder

◆ executes() [4/4]

default Impl dev.jorel.commandapi.BukkitExecutable< Impl >.executes ( ResultingCommandExecutor  executor,
ExecutorType...  types 
)
inherited

Adds an executor to the current command builder.

Parameters
executorA lambda of type (CommandSender, CommandArguments) -> int that will be executed when the command is run
typesA list of executor types to use this executes method for.
Returns
this command builder

◆ executesCommandBlock() [1/4]

default Impl dev.jorel.commandapi.BukkitExecutable< Impl >.executesCommandBlock ( CommandBlockCommandExecutor  executor)
inherited

Adds an executor to the current command builder.

Parameters
executorA lambda of type (BlockCommandSender, CommandArguments) -> () that will be executed when the command is run
Returns
this command builder

◆ executesCommandBlock() [2/4]

default Impl dev.jorel.commandapi.BukkitExecutable< Impl >.executesCommandBlock ( CommandBlockExecutionInfo  info)
inherited

Adds an executor to the current command builder.

Parameters
infoA lambda of type (ExecutionInfo) -> () that will be executed when the command is run
Returns
this command builder

◆ executesCommandBlock() [3/4]

default Impl dev.jorel.commandapi.BukkitExecutable< Impl >.executesCommandBlock ( CommandBlockResultingCommandExecutor  executor)
inherited

Adds an executor to the current command builder.

Parameters
executorA lambda of type (BlockCommandSender, CommandArguments) -> int that will be executed when the command is run
Returns
this command builder

◆ executesCommandBlock() [4/4]

default Impl dev.jorel.commandapi.BukkitExecutable< Impl >.executesCommandBlock ( CommandBlockResultingExecutionInfo  info)
inherited

Adds an executor to the current command builder.

Parameters
infoA lambda of type (ExecutionInfo) -> int that will be executed when the command is run
Returns
this command builder

◆ executesConsole() [1/4]

default Impl dev.jorel.commandapi.BukkitExecutable< Impl >.executesConsole ( ConsoleCommandExecutor  executor)
inherited

Adds an executor to the current command builder.

Parameters
executorA lambda of type (ConsoleCommandSender, CommandArguments) -> () that will be executed when the command is run
Returns
this command builder

◆ executesConsole() [2/4]

default Impl dev.jorel.commandapi.BukkitExecutable< Impl >.executesConsole ( ConsoleExecutionInfo  info)
inherited

Adds an executor to the current command builder.

Parameters
infoA lambda of type (ExecutionInfo) -> () that will be executed when the command is run
Returns
this command builder

◆ executesConsole() [3/4]

default Impl dev.jorel.commandapi.BukkitExecutable< Impl >.executesConsole ( ConsoleResultingCommandExecutor  executor)
inherited

Adds an executor to the current command builder.

Parameters
executorA lambda of type (ConsoleCommandSender, CommandArguments) -> int that will be executed when the command is run
Returns
this command builder

◆ executesConsole() [4/4]

default Impl dev.jorel.commandapi.BukkitExecutable< Impl >.executesConsole ( ConsoleResultingExecutionInfo  info)
inherited

Adds an executor to the current command builder.

Parameters
infoA lambda of type (ExecutionInfo) -> int that will be executed when the command is run
Returns
this command builder

◆ executesEntity() [1/4]

default Impl dev.jorel.commandapi.BukkitExecutable< Impl >.executesEntity ( EntityCommandExecutor  executor)
inherited

Adds an executor to the current command builder.

Parameters
executorA lambda of type (Entity, CommandArguments) -> () that will be executed when the command is run
Returns
this command builder

◆ executesEntity() [2/4]

default Impl dev.jorel.commandapi.BukkitExecutable< Impl >.executesEntity ( EntityExecutionInfo  info)
inherited

Adds an executor to the current command builder.

Parameters
infoA lambda of type (ExecutionInfo) -> () that will be executed when the command is run
Returns
this command builder

◆ executesEntity() [3/4]

default Impl dev.jorel.commandapi.BukkitExecutable< Impl >.executesEntity ( EntityResultingCommandExecutor  executor)
inherited

Adds an executor to the current command builder.

Parameters
executorA lambda of type (Entity, CommandArguments) -> int that will be executed when the command is run
Returns
this command builder

◆ executesEntity() [4/4]

default Impl dev.jorel.commandapi.BukkitExecutable< Impl >.executesEntity ( EntityResultingExecutionInfo  info)
inherited

Adds an executor to the current command builder.

Parameters
infoA lambda of type (ExecutionInfo) -> int that will be executed when the command is run
Returns
this command builder

◆ executesFeedbackForwarding() [1/4]

default Impl dev.jorel.commandapi.BukkitExecutable< Impl >.executesFeedbackForwarding ( FeedbackForwardingCommandExecutor  executor)
inherited

Adds an executor to the current command builder.

Parameters
executorA lambda of type (FeedbackForwardingCommandExecutor, CommandArguments) -> () that will be executed when the command is run
Returns
this command builder

◆ executesFeedbackForwarding() [2/4]

default Impl dev.jorel.commandapi.BukkitExecutable< Impl >.executesFeedbackForwarding ( FeedbackForwardingExecutionInfo  info)
inherited

Adds an executor to the current command builder.

Parameters
infoA lambda of type (ExecutionInfo) -> () that will be executed when the command is run
Returns
this command builder

◆ executesFeedbackForwarding() [3/4]

default Impl dev.jorel.commandapi.BukkitExecutable< Impl >.executesFeedbackForwarding ( FeedbackForwardingResultingCommandExecutor  executor)
inherited

Adds an executor to the current command builder.

Parameters
executorA lambda of type (FeedbackForwardingCommandExecutor, CommandArguments) -> int that will be executed when the command is run
Returns
this command builder

◆ executesFeedbackForwarding() [4/4]

default Impl dev.jorel.commandapi.BukkitExecutable< Impl >.executesFeedbackForwarding ( FeedbackForwardingResultingExecutionInfo  info)
inherited

Adds an executor to the current command builder.

Parameters
infoA lambda of type (ExecutionInfo) -> int that will be executed when the command is run
Returns
this command builder

◆ executesNative() [1/4]

default Impl dev.jorel.commandapi.BukkitExecutable< Impl >.executesNative ( NativeCommandExecutor  executor)
inherited

Adds an executor to the current command builder.

Parameters
executorA lambda of type (NativeCommandExecutor, CommandArguments) -> () that will be executed when the command is run
Returns
this command builder

◆ executesNative() [2/4]

default Impl dev.jorel.commandapi.BukkitExecutable< Impl >.executesNative ( NativeExecutionInfo  info)
inherited

Adds an executor to the current command builder.

Parameters
infoA lambda of type (ExecutionInfo) -> () that will be executed when the command is run
Returns
this command builder

◆ executesNative() [3/4]

default Impl dev.jorel.commandapi.BukkitExecutable< Impl >.executesNative ( NativeResultingCommandExecutor  executor)
inherited

Adds an executor to the current command builder.

Parameters
executorA lambda of type (NativeCommandExecutor, CommandArguments) -> int that will be executed when the command is run
Returns
this command builder

◆ executesNative() [4/4]

default Impl dev.jorel.commandapi.BukkitExecutable< Impl >.executesNative ( NativeResultingExecutionInfo  info)
inherited

Adds an executor to the current command builder.

Parameters
infoA lambda of type (ExecutionInfo) -> int that will be executed when the command is run
Returns
this command builder

◆ executesPlayer() [1/4]

default Impl dev.jorel.commandapi.BukkitExecutable< Impl >.executesPlayer ( PlayerCommandExecutor  executor)
inherited

Adds an executor to the current command builder.

Parameters
executorA lambda of type (Player, CommandArguments) -> () that will be executed when the command is run
Returns
this command builder

◆ executesPlayer() [2/4]

default Impl dev.jorel.commandapi.BukkitExecutable< Impl >.executesPlayer ( PlayerExecutionInfo  info)
inherited

Adds an executor to the current command builder.

Parameters
infoA lambda of type (ExecutionInfo) -> () that will be executed when the command is run
Returns
this command builder

◆ executesPlayer() [3/4]

default Impl dev.jorel.commandapi.BukkitExecutable< Impl >.executesPlayer ( PlayerResultingCommandExecutor  executor)
inherited

Adds an executor to the current command builder.

Parameters
executorA lambda of type (Player, CommandArguments) -> int that will be executed when the command is run
Returns
this command builder

◆ executesPlayer() [4/4]

default Impl dev.jorel.commandapi.BukkitExecutable< Impl >.executesPlayer ( PlayerResultingExecutionInfo  info)
inherited

Adds an executor to the current command builder.

Parameters
infoA lambda of type (ExecutionInfo) -> int that will be executed when the command is run
Returns
this command builder

◆ executesProxy() [1/4]

default Impl dev.jorel.commandapi.BukkitExecutable< Impl >.executesProxy ( ProxyCommandExecutor  executor)
inherited

Adds an executor to the current command builder.

Parameters
executorA lambda of type (Entity, CommandArguments) -> () that will be executed when the command is run
Returns
this command builder

◆ executesProxy() [2/4]

default Impl dev.jorel.commandapi.BukkitExecutable< Impl >.executesProxy ( ProxyExecutionInfo  info)
inherited

Adds an executor to the current command builder.

Parameters
infoA lambda of type (ExecutionInfo) -> () that will be executed when the command is run
Returns
this command builder

◆ executesProxy() [3/4]

default Impl dev.jorel.commandapi.BukkitExecutable< Impl >.executesProxy ( ProxyResultingCommandExecutor  executor)
inherited

Adds an executor to the current command builder.

Parameters
executorA lambda of type (Entity, CommandArguments) -> int that will be executed when the command is run
Returns
this command builder

◆ executesProxy() [4/4]

default Impl dev.jorel.commandapi.BukkitExecutable< Impl >.executesProxy ( ProxyResultingExecutionInfo  info)
inherited

Adds an executor to the current command builder.

Parameters
infoA lambda of type (ExecutionInfo) -> int that will be executed when the command is run
Returns
this command builder

◆ executesRemoteConsole() [1/4]

default Impl dev.jorel.commandapi.BukkitExecutable< Impl >.executesRemoteConsole ( RemoteConsoleCommandExecutor  executor)
inherited

Adds an executor to the current command builder.

Parameters
executorA lambda of type (RemoteConsoleCommandExecutor, CommandArguments) -> () that will be executed when the command is run
Returns
this command builder

◆ executesRemoteConsole() [2/4]

default Impl dev.jorel.commandapi.BukkitExecutable< Impl >.executesRemoteConsole ( RemoteConsoleExecutionInfo  info)
inherited

Adds an executor to the current command builder.

Parameters
infoA lambda of type (ExecutionInfo) -> () that will be executed when the command is run
Returns
this command builder

◆ executesRemoteConsole() [3/4]

default Impl dev.jorel.commandapi.BukkitExecutable< Impl >.executesRemoteConsole ( RemoteConsoleResultingCommandExecutor  executor)
inherited

Adds an executor to the current command builder.

Parameters
executorA lambda of type (RemoteConsoleResultingCommandExecutor, CommandArguments) -> int that will be executed when the command is run
Returns
this command builder

◆ executesRemoteConsole() [4/4]

default Impl dev.jorel.commandapi.BukkitExecutable< Impl >.executesRemoteConsole ( RemoteConsoleResultingExecutionInfo  info)
inherited

Adds an executor to the current command builder.

Parameters
infoA lambda of type (ExecutionInfo) -> int that will be executed when the command is run
Returns
this command builder

◆ register() [1/2]

void dev.jorel.commandapi.CommandTree.register ( JavaPlugin  plugin)

Registers this command with a given JavaPlugin instance.

Parameters
pluginThe plugin instance used to determine this command's namespace

◆ register() [2/2]

void dev.jorel.commandapi.CommandTree.register ( String  namespace)

Registers the command with a given namespace.

Parameters
namespaceThe namespace of this command. This cannot be null or empty

◆ then()

Impl dev.jorel.commandapi.AbstractCommandTree< Impl, Argument, CommandSender >.then ( final AbstractArgumentTree<?, Argument, CommandSender >  tree)
inherited

Create a child branch on the tree.

Parameters
treethe child node
Returns
this root node

◆ thenNested() [1/2]

final Impl dev.jorel.commandapi.AbstractCommandTree< Impl, Argument, CommandSender >.thenNested ( final AbstractArgumentTree<?, Argument, CommandSender >...  trees)
inherited

Creates a chain of child branches starting at this node.

thenNested(a, b, c) is equivalent to then(a.then(b.then(c))).

Parameters
treesThe child branches to add in a chain.
Returns
this tree node

◆ thenNested() [2/2]

final Impl dev.jorel.commandapi.AbstractCommandTree< Impl, Argument, CommandSender >.thenNested ( List< AbstractArgumentTree<?, Argument, CommandSender > >  trees)
inherited

Creates a chain of child branches starting at this node.

thenNested(a, b, c) is equivalent to then(a.then(b.then(c))).

Parameters
treesThe child branches to add in a chain.
Returns
this tree node