Package com.velocitypowered.api.command
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 Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidexecute(I invocation)Executes the command for the specified invocation.default booleanhasPermission(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.default CompletableFuture<List<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 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:
trueif the source has permission
-
-