TabComplete
For add Tab Completion to your command, you can use @TabComplete annotation:
@Command("test")
@TabComplete(["#range:1-100", "#test"])
fun tabExample(sender: Sender, arg1: Int, arg2: String) {
}@TabComplete has one parameter - list of tags for tab completion. Indexes in the list correspond to the indexes of the command arguments.
Default Completions
#players - list of players online
#offlinePlayers - list of all players
#worlds - list of worlds
#materials - list of all materials
Registration custom completion
Use CommandManager instance for it:
commandManager.tabComplete("#cities") { sender ->
listOf("New-York", "London", "Moscow")
}Last updated