Solved Disabling command tab completion in 1.8

Discussion in 'Plugin Development' started by MarinD99, Jan 2, 2017.

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


    I'm trying to figure out a way to disable any and all tab completions for commands executed via PlayerCommandPreProcessEvent, but I'm unsure of the best way to do so. I'm aware of the TabCompleteEvent, which works as expected, but only in 1.10 and beyond. What are your recommendations for such a thing?
  2. Maybe using PlayerChatTabCompleteEvent?
  3. Offline


    @Minecraft1o1 tried that, didn't work. And you can't really cancel that event, you can only clear the tab completions for the specific commands.
  4. Offline


    I have tried this using many different ways with no luck. I have also researched it and I don't think there is an easy way to doing this..
  5. Offline


    @mehboss @MarinD99 @Minecraft1o1
    There is no base-bukkit methods for modifying the tablist. If you want to modify the commands that are shown, you will need to use Protocol Lib (which is not that bad. I have to say this because there are a lot of people who don't like using it for some reason)
    This is the packet that gets sent when a player asks for tab-completion. You will have to listen for this packet and remove the commands you do not want to be displayed.

    [Edit] You will also want to disable the /plugins command as well. If a player knows what plugins you have, they will be able to know what commands are available. Use CommandPreProccessEvent and check if the command is equal to "plugins". If so, cancel the event and send a new, modified message.
    MarinD99 and I Al Istannen like this.
  6. Offline


    @Zombie_Striker very useful information, thank you for responding! Marking the thread as solved.
Thread Status:
Not open for further replies.

Share This Page