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.
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      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 java.util.List<java.lang.String> suggest​(I invocation)
      Provides tab complete suggestions for the specified invocation.
      default java.util.concurrent.CompletableFuture<java.util.List<java.lang.String>> suggestAsync​(I invocation)
      Provides tab complete suggestions for the specified invocation.
    • Method Detail

      • execute

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

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

        default java.util.concurrent.CompletableFuture<java.util.List<java.lang.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