Interface Command
-
- All Known Implementing Classes:
AbstractCommand
public interface Command
Represents a command.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default @NotNull @Unmodifiable Set<String>
getAliases()
Gets aliases of this command.@NotNull String
getName()
Gets the name of this command.@NotNull String
getPermission()
Gets the permission to execute this command.@NotNull CommandResult
onExecution(@NotNull CommandContext context)
The method to call when this command is executed.@NotNull List<String>
onTabCompletion(@NotNull CommandContext context)
The method to call when command tab completion is requested.
-
-
-
Method Detail
-
getName
@NotNull @NotNull String getName()
Gets the name of this command.- Returns:
- the name of this command
-
getPermission
@NotNull @NotNull String getPermission()
Gets the permission to execute this command.- Returns:
- the permission to execute this command
-
getAliases
@NotNull default @NotNull @Unmodifiable Set<String> getAliases()
Gets aliases of this command.- Returns:
- aliases of this command
-
onExecution
@NotNull @NotNull CommandResult onExecution(@NotNull @NotNull CommandContext context)
The method to call when this command is executed.- Parameters:
context
- the context of the executed command- Returns:
- the execution result
-
onTabCompletion
@NotNull @NotNull List<String> onTabCompletion(@NotNull @NotNull CommandContext context)
The method to call when command tab completion is requested.- Parameters:
context
- the context of the command line when tab completion is requested- Returns:
- the tab completion result
-
-