Tab completion doesn't trigger when I press <space> but only when I begin typing the next argument

XMLWordPrintable

    • Type: Bug
    • Resolution: Cannot Reproduce
    • Priority: Minor
    • None
    • Affects Version/s: None
    • None
    • Environment:

      Fedora 32 64-bit OpenJVM

    • 3002-Spigot-138d451-085fe67
    • Yes

      When typing the native command /recipe and then <space> I am given a list of acceptable options "give" and "take".

      I want to provide tab completion like this.

      I implemented TabCompleter correctly but the onTabComplete() method is only ever called when I begin typing the argument after a space. It does not get called after the initial <space> and therefore does not provide a list of acceptable arguments until you start pressing random keys after the space.

      I get the correct list of options when pressing tab at the console but as a player in Minecraft tab will only complete my player name until I begin typing.

      My tab completion object is simple. It prints a message to the console every time it is triggered and always returns a list of two options:

       

       

      public class OnTabComplete implements TabCompleter {
         @Override
         public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
            System.out.println(command.getName());
         
            return Arrays.asList(new String[] { "apple""pear" });
         }
      }
      

      The issue is that it never gets called when I type the command and <space>. It only gets called after I begin typing the first argument.

       

            Assignee:
            Unassigned
            Reporter:
            Matt D.
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: