Tab complete names

Discussion in 'Spigot Plugin Development' started by Kenax, Jul 10, 2017.

  1. Hey, how can I change players default nickname (example: Karlo) to their disguise nickname (example: SpongeBob) in chat tab complete? For example when someone is disguised, and someone try to msg him, he do /msg <tab> or any other command and shows disguised nickname, not his real, hope you understanded me!
     
  2. You'd need to control that in the message plugin itself.
     
    • Like Like x 1
    • Agree Agree x 1
  3. ScarabCoder

    ScarabCoder Retired Resource Staff
    Retired

    You probably want custom tab completion. The best way is to use Plugin#getCommand#setTabCompleter, and have a class implement TabCompleter. You *should* be able to use Plugin#getCommand for getting commands from other plugins, not 100% sure about that.
     
    • Agree Agree x 1
  4. That would be necessary if you want it to complete, for example, arguments.
     
    • Agree Agree x 1
  5. ScarabCoder

    ScarabCoder Retired Resource Staff
    Retired

    Well technically the player username is an argument, but I see what you mean.
     
  6. simplest way would be to change how you disguise your player, I am guessing that you send packets to each and every player, that does not effect server, but shows different in client, now, if you could find a way to make it so that the name is also disguised on the server side, I know how to do this, but won't tell you, you should go on that journey alone