Interface InvocableCommand<I extends CommandInvocation<?>>

  • Type Parameters:
    I - the type of the command invocation object
    All Superinterfaces:
    Command
    All Known Subinterfaces:
    RawCommand, SimpleCommand

    public interface InvocableCommand<I extends CommandInvocation<?>>
    extends Command
    A command that can be executed with arbitrary arguments.

    Modifying the command tree (e.g. registering a command via CommandManager.register(CommandMeta, Command)) during permission checking and suggestions provision results in undefined behavior, which may include deadlocks.

    • Method Detail

      • execute

        void execute​(I invocation)
        Executes the command for the specified invocation.
        Parameters:
        invocation - the invocation context
      • suggest

        default List<String> suggest​(I invocation)
        Provides tab complete suggestions for the specified invocation.
        Parameters:
        invocation - the invocation context
        Returns:
        the tab complete suggestions
      • suggestAsync

        default CompletableFuture<List<String>> suggestAsync​(I invocation)
        Provides tab complete suggestions for the specified invocation.
        Parameters:
        invocation - the invocation context
        Returns:
        the tab complete suggestions
      • hasPermission

        default boolean hasPermission​(I invocation)
        Tests to check if the source has permission to perform the specified invocation.

        If the method returns false, the handling is forwarded onto the players current server.

        Parameters:
        invocation - the invocation context
        Returns:
        true if the source has permission