onTabComplete

open override fun onTabComplete(sender: CommandSender, command: Command, alias: String, args: Array<out String>): List<String>?

Provides tab completion suggestions for the /core command.

This method implements intelligent tab completion to improve user experience when typing commands. It provides context-aware suggestions based on the current input and supports partial matching for efficient command entry.

Completion Logic:

  • For first argument: Suggests available subcommands that match the current input

  • For additional arguments: Returns empty list (no further completion needed)

  • Uses case-insensitive partial matching for flexible input

  • Automatically sorts suggestions alphabetically for consistent ordering

Available Completions:

  • info - Complete subcommand name for information display

  • reload - Complete subcommand name for configuration reload

  • testplugin - Complete subcommand name for system diagnostics

Features:

  • Partial string matching using StringUtil.copyPartialMatches

  • Automatic sorting of completion results

  • Case-insensitive input handling

  • Efficient early return for unsupported argument positions

Return

List of completion suggestions, or null if no completions are available - For first argument: List of matching subcommands - For other positions: Empty list

Parameters

sender

The CommandSender requesting tab completion

command

The Command being completed

alias

The command alias being used (if any)

args

Array of current command arguments being completed

See also

StringUtil.copyPartialMatches