-
Notifications
You must be signed in to change notification settings - Fork 3
Command Suggestions
Mazen edited this page May 7, 2023
·
1 revision
To add specific things to suggest while pressing tab to complete the argument,
you need to use Argument#suggest(T suggestionThing)
where T
is the type of the argument
here's a simple example of creating an argument with suggestions:
Argument.word("test")
.suggest("obama")
.suggest("7mada");
Simply by using @Suggest
here's a friendly example:
@Command(name = "example")
public class TestAnnotatedCommand {
@CommandSyntaxMeta(syntax = "<firstArg>")
public void firstArgumentExample(@NotNull CommandSender sender,
@NotNull @Arg(id= "firstArg") @Suggest({"first", "first2", "first3"}) String firstArg) {
sender.sendMessage(firstArg);
}
}
I hope this wiki helped you with learning how to fully utilize mCommands