Interface CommandNode<T extends PermissionHolder>
- Type Parameters:
T- the type of object to pass in command context
- All Known Implementing Classes:
AbstractNode,HelpNode,PluginInfoNode,SubcommandHelpNode,SubcommandNode
public interface CommandNode<T extends PermissionHolder>
A node as part of a command chain.
- Since:
- 2.0.0
-
Method Summary
Modifier and TypeMethodDescription@Nullable net.kyori.adventure.text.Componentexecute(CommandContext context) Execute this node.default @NotNull List<CommandArgument<?>>Gets this command's arguments.@NotNull Condition<PermissionHolder,? extends T> Gets the condition needed to execute this node or any children.Gets this node's description for use in help commands.@NotNull StringgetName()Gets this node's name, which will be used as a literal if needed.default @Nullable CommandNode<? extends T>next(CommandContext context) Returns the node following this node.default CommandNode<T>withExtraCondition(Condition<? super T, ? extends T> other)
-
Method Details
-
execute
Execute this node. This will only be executed if there are no further nodes in the chain.- Parameters:
context- the context that this command was executed in- Returns:
- a component to optionally
-
getName
Gets this node's name, which will be used as a literal if needed. -
getDescription
String getDescription()Gets this node's description for use in help commands. This should be a simple, one-line sentence. -
getCondition
Gets the condition needed to execute this node or any children. If not needed, use PermissionHolder as T and returnCondition.alwaysTrue()- Returns:
- the condition
-
getArguments
Gets this command's arguments. By default, returns an empty list. -
next
Returns the node following this node.- Returns:
- the next node in the chain, or if this is the end of the chain, null
-
withExtraCondition
-