public interface Command
CommandSource
such as a Player or the console.
Velocity 1.1.0 introduces specialized command subinterfaces to separate command parsing concerns. These include, in order of preference:
BrigadierCommand, which supports parameterized arguments and
specialized execution, tab complete suggestions and permission-checking logic.
SimpleCommand, modelled after the convention popularized by
Bukkit and BungeeCord. Older classes directly implementing Command
are suggested to migrate to this interface.
RawCommand, useful for bolting on external command frameworks
to Velocity.
For this reason, the legacy execute, suggest and
hasPermission methods are deprecated and will be removed
in Velocity 2.0.0. We suggest implementing one of the more specific
subinterfaces instead.
The legacy methods are executed by a CommandManager if and only if
the given command directly implements this interface.
| Modifier and Type | Method and Description |
|---|---|
default void |
execute(CommandSource source,
String[] args)
Deprecated.
see
Command |
default boolean |
hasPermission(CommandSource source,
String[] args)
Deprecated.
see
Command |
default List<String> |
suggest(CommandSource source,
String[] currentArgs)
Deprecated.
see
Command |
default CompletableFuture<List<String>> |
suggestAsync(CommandSource source,
String[] currentArgs)
Deprecated.
see
Command |
@Deprecated default void execute(CommandSource source, String[] args)
Commandsource - the source to execute the command forargs - the arguments for the command@Deprecated default List<String> suggest(CommandSource source, String[] currentArgs)
Commandsource - the source to execute the command forcurrentArgs - the partial arguments for the command@Deprecated default CompletableFuture<List<String>> suggestAsync(CommandSource source, String[] currentArgs)
Commandsource - the source to execute the command forcurrentArgs - the partial arguments for the command@Deprecated default boolean hasPermission(CommandSource source, String[] args)
Commandsource - the source to execute the command forargs - the arguments for the commandtrue if the source has permission