Skip to content
sk89q edited this page Aug 19, 2014 · 2 revisions

Intake supports providing argument auto-completion suggestions.

CommandCallable implements CommandCompleter, which defines

List<String> getSuggestions(String arguments, CommandLocals locals)

Implementations do have to parse the arguments, which may contain values for several parameters. The list of suggestions is ultimately returned to your calling code, so you can handle it however you want. In Intake though, convention is to return a list of possible arguments that can be completed without removing any characters that have been typed.

For example, if the user has typed t, then suggestions would include "teleport" and "tp", including the typed letter(s).

Dispatchers

Dispatchers should generally implement suggestions to auto-complete sub-commands.

SimpleDispatcher in Intake will complete sub-commands and also use testPermission() to hide commands that the user cannot use.

Clone this wiki locally