Change Playername in Autocomplete

Discussion in 'Plugin Development' started by Unknown025, Jan 20, 2018.

Thread Status:
Not open for further replies.
  1. Offline

    Unknown025

    Hello everyone.
    I was working on a command which would change your display name using a combination of the setDisplayName() method, setPlayerListName() method, and TagAPI, however the only place the username does not get changed is when you press tab to autocomplete a command. Is there any way to change it?
     
  2. Offline

    Machine Maker

    You might be able to listen to the PlayerChatTabCompleteEvent and do something there. I'm not sure though. I've never messed around with that.
     
  3. Offline

    Unknown025

    That only seems to work if there's no "/" in the chat box already entered. For commands, it doesn't work. I did verify that the event works, it just doesn't work for commands.
     
  4. Offline

    Colinus999

    To change it for your plugin commands override the onTabComplete method in your main class. Or use getPluginCommand("mycommand").setTabCompleter(new MyTabCompleter())
    There you can set the tabbable Strings manually.
     
  5. Offline

    Unknown025

    Yes, but if I want to override it server-wide? Apparently they introduced such an event in Spigot 1.9 or so, but for Craftbukkit 1.7.10 people had to intercept packets. Still haven't found the best way to solve this yet.
     
Thread Status:
Not open for further replies.

Share This Page