Interface BasicCommand
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Implementing this interface allows for easily creating "Bukkit-style"
String[] args commands.
The implementation handles converting the command to a representation compatible with Brigadier on registration, usually in the form of /commandlabel <greedy_string>.-
Method Summary
Modifier and TypeMethodDescriptionvoidexecute(@NotNull CommandSourceStack commandSourceStack, @NotNull String[] args) Executes the command with the givenCommandSourceStackand arguments.default @NotNull Collection<String> suggest(@NotNull CommandSourceStack commandSourceStack, @NotNull String[] args) Suggests possible completions for the given commandCommandSourceStackand arguments.
-
Method Details
-
execute
@OverrideOnly void execute(@NotNull @NotNull CommandSourceStack commandSourceStack, @NotNull @NotNull String[] args) Executes the command with the givenCommandSourceStackand arguments.- Parameters:
commandSourceStack- the commandSourceStack of the commandargs- the arguments of the command ignoring repeated spaces
-
suggest
@OverrideOnly @NotNull default @NotNull Collection<String> suggest(@NotNull @NotNull CommandSourceStack commandSourceStack, @NotNull @NotNull String[] args) Suggests possible completions for the given commandCommandSourceStackand arguments.- Parameters:
commandSourceStack- the commandSourceStack of the commandargs- the arguments of the command including repeated spaces- Returns:
- a collection of suggestions
-