1.15.2 Putting errors in tab complete?

Discussion in 'Spigot Plugin Development' started by Big_Bad_E, Mar 9, 2020.

  1. I've been investigating into putting errors into the tab complete popup, but the problem is if they are in red (using chatcolor) tab completing the message kicks the player.

    I tried editing the TabComplete packet that is client-bound (here), but that is called to send suggestions, and the other thing I wanted to do (remove the text in the chat bar) doesn't work, if the text is blank/null it doesnt show the first suggestion.

    I tried TabCompleteEvent but all I could do is cancel the event.

    I tried the TabComplete packet server-bound (here), but that is called to ask for tab completes, not on tab complete.

    I'm out of ideas, if this isn't possible I'll just give up, I just wanted to achieve an effect like this:
    upload_2020-3-8_19-31-30.png
    Hypixel seems to do it with their commands:
    upload_2020-3-8_19-32-47.png
     
  2. It cannot be done via the Spigot API since it requires the Brigadier library which Spigot doesn’t support. Essentially, using Brigadier you would send a supported NMS/Brigadier type to the client. The client would then parse the player’s input and display the error accordingly.

    On a side note, you can have a look at either https://github.com/lucko/commodore or https://github.com/Pante/Chimera
     
  3. Andre_601

    Supporter

    I would highly suggest using Commodore from Luck, as this adds 1.13 tab completion (brigadier support) to your commands, which is as easy as creating a .commodore file and then parsing it.
    Sadly, the repo lacks a bit of documentation on what you can do, but I guess looking at LuckPerms' .commodore file would give you some idea what each option does.