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 Details

    • execute

      @Nullable @Nullable net.kyori.adventure.text.Component execute(CommandContext context)
      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

      @NotNull @NotNull String 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

      @NotNull @NotNull Condition<PermissionHolder,​? extends T> getCondition()
      Gets the condition needed to execute this node or any children. If not needed, use PermissionHolder as T and return Condition.alwaysTrue()
      Returns:
      the condition
    • getArguments

      @NotNull default @NotNull List<CommandArgument<?>> getArguments()
      Gets this command's arguments. By default, returns an empty list.
    • next

      @Nullable default @Nullable CommandNode<? extends T> next(CommandContext context)
      Returns the node following this node.
      Returns:
      the next node in the chain, or if this is the end of the chain, null
    • withExtraCondition

      default CommandNode<T> withExtraCondition(Condition<? super T,​? extends T> other)