Class TabCompletion

java.lang.Object
valorless.rarespawns.TabCompletion
All Implemented Interfaces:
org.bukkit.command.TabCompleter

public class TabCompletion extends Object implements org.bukkit.command.TabCompleter
Tab completer for RareSpawns commands.

Provides context-aware suggestions for subcommands and arguments based on the sender's permissions and current argument position. Supported subcommands include: reload, item, give, spawn, and kill.

  • Constructor Details

    • TabCompletion

      public TabCompletion()
  • Method Details

    • onTabComplete

      public List<String> onTabComplete(org.bukkit.command.CommandSender sender, org.bukkit.command.Command command, String alias, String[] args)
      Computes tab-completion candidates for RareSpawns.

      Behavior:

      • args[0]: suggests subcommands permitted for the sender.
      • args[1]: suggests sub-args for reload (abilities, config, entities, items, soulpowers), item (configured item ids), spawn (configured entity ids), kill (<radius>), give (online player names).
      • args[2]: suggests online player names for spawn and "random" for item, and item ids for give subcommand.
      • args[3]: suggests "random" for give subcommand.
      Results are filtered using
      invalid reference
      StringUtil#copyPartialMatches(String, java.util.List, java.util.List)
      .

      Specified by:
      onTabComplete in interface org.bukkit.command.TabCompleter
      Parameters:
      sender - the command sender requesting suggestions
      command - the command being executed
      alias - the alias used to invoke the command
      args - the raw arguments passed so far
      Returns:
      a list of suggestions (never null)