Mineplex Tabbing Commands not working

Discussion in 'Plugin Development' started by Minecraft Server Network, Jun 12, 2015.

Thread Status:
Not open for further replies.
  1. MAUX GAMES // INNOVATOR //

    I got the code already set up, It is just not working, though! What this plugin class does is that when you tab out something, it will only show the commands in the parentheses, regardless you being an Operator or not.

    Here is the code

    ••••••••••••••••••••••••••••••

    Code:

    @EventHandler

    public void onPlayerListTabComplete(PlayerChatTabCompleteEvent e) {

    Player p = e.getPlayer();

    if (p.isOp()) {

    e.getTabCompletions().addAll(Arrays.asList(
    "/?", "/bukkit:?", "bukkit:help", "/bukkit:kill", "/bukkit:me", "/bukkit:msg", "/bukkit:tell", "/bukkit:w", "/help", "/kill", "/me", "/msg", "/tell", "/w"));

    } else if (!p.isOp()) {

    e.getTabCompletions().addAll(Arrays.asList(
    "/?", "/bukkit:?", "bukkit:help", "/bukkit:kill", "/bukkit:me", "/bukkit:msg", "/bukkit:tell", "/bukkit:w", "/help", "/kill", "/me", "/msg", "/tell", "/w"));

    }

    }




    ••••••••••••••••••••••••••••••
     
  2. Offline

    I Al Istannen

    @Minecraft Server Network You add the exact same things for ops and non ops. What's the point. And, Im not sure about this. But won't ".addAll()" just add the things and not replace?
     
  3. I added a new line of code above

    e.getTabCompletions().addAll(
    Arrays.asList("/?", "/bukkit:?", "bukkit:help",
    "/bukkit:kill", "/bukkit:me", "/bukkit:msg",
    "/bukkit:tell", "/bukkit:w", "/help", "/kill",
    "/me", "/msg", "/tell", "/w"
    ));

    and it is:

    e.getTabCompletions().clear();

    Would that make a difference?


    @I Al Istannen
     
  4. Offline

    I Al Istannen

    @Minecraft Server Network I don't even know if it works that way. It should though. Give me a few minutes, i will look into it.
     
  5. If the player isn't op, clear all tabcompletions and add the one's you want
     
  6. Offline

    I Al Istannen

    @Minecraft Server Network It looks like it only fires when completing chat messages. Not by completing commands (starting with "/").
    That would explain the name and the description.... Maybe that's why there is command.setTabCompletor().
    Or did I sth. horrible wrong? @FisheyLP
     
  7. Your right
    @I Al Istannen ... So how do I make that it does commands?
     
Thread Status:
Not open for further replies.

Share This Page