Interface InvocableCommand<I extends CommandInvocation<?>>

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

public sealed interface InvocableCommand<I extends CommandInvocation<?>> extends Command permits RawCommand, SimpleCommand
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 Summary

    Modifier and Type
    Method
    Description
    void
    execute(I invocation)
    Executes the command for the specified invocation.
    default boolean
    hasPermission(I invocation)
    Tests to check if the source has permission to perform the specified invocation.
    default List<String>
    suggest(I invocation)
    Provides tab complete suggestions for the specified invocation.
    suggestAsync(I invocation)
    Provides tab complete suggestions for the specified invocation.
  • Method Details

    • 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
      Implementation Requirements:
      defaults to wrapping the value returned by suggest(CommandInvocation)
    • 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