Is this possible without protocollib?

Discussion in 'Spigot Plugin Development' started by Kyllian, Apr 25, 2017.

  1. Hey,

    I want to build in a PluginHider

    I tried the TabCompleteEvent, No succes. I want to check where the message starts with, and if it is equals to something cancel it.

    Something like this:

    Code (Text):
        public void onTabCompleteEvent(TabCompleteEvent e) {
            List<String> blocked = sys32.getConfig().getStringList("PluginHiderCommands");
            for (String str : blocked) {
                if (e.getMessage().startsWith(str)) {

  2. e.getMessage().startsWith(str)


    ** facepalm **
    • Funny Funny x 1
    • Optimistic Optimistic x 1
  3. [​IMG]
  4. "Is this possible without protocollib?"

    Everything is possible without Protocollib because it is also made using plain Java. However, some things would be way more complicated without it.
    • Agree Agree x 1
  5. Exactly that?
    Say the word 'pillow' was in the blocked list, and your attempt before tab completing was 'pill'
    You would want to check if 'pillow' starts with 'pill'
    You wouldn't want to check to see if 'pill' starts with 'pillow'


    Sent from my iPhone using Tapatalk
  6. You're kidding me, right? There's isn't even a String or method called 'str'. You're essentially just throwing nullPointer exceptions. Make sure you've read before you try correcting someone.
  7. It wouldn't compile, NPEs are not relevant here. The variable str is here, representing each entry in the list.
  8. There are too many things to laugh about in this thread right now.
  9. I think, the best way to do that is inside a class. click:command-gist you just have to override
    Code (Text):
    protected List<String> tabCompleter(Player player, String[] args);
    with what you want. (you will need this: click:abstractcommand-gist)