Tab list question

Discussion in 'Plugin Development' started by Blackwing_Forged, Aug 8, 2017.

Thread Status:
Not open for further replies.
  1. Is it possible to have a separate tab list for each world, for example if I'm in the overworld and so are Fred and bob. And George is in the nether with Nichole and Seven, if George presses tab he will see that only him, Nichole, and Steven are on but if Fred presses tab it will show only Fred, Bob, and me. Basically can i edit what the tab list displays for certain players, like getting all the players in that specific world and applying that to every player in that world.
     
  2. Offline

    Zombie_Striker

  3. So this is per person right? everyone sees different things when in different worlds?
     
  4. Offline

    Zombie_Striker

  5. I'm really confused on how to add and remove players, could you clarify for me, and yes i read the methods but that didn't really explain much. So I have a player join event to send the players to the hub then i also have a sign event that teleports the player to a different world how do i set up the tab for it
     
  6. Offline

    Zombie_Striker

    @Blackwing_Forged
    Whenever you want to add a new player, use PlayerList#addValue(INDEX, "Player's name");
     
  7. @Zombie_Striker
    So something like this would work fine:

    Code:
    int index = 0;
           
            for(Player player : Bukkit.getWorld("Faction").getPlayers())
            {
                PlayerList.getPlayerList(player).addValue(index, player.getName());
                index++;
            }
     
  8. Offline

    Zombie_Striker

    @Blackwing_Forged
    Yes. Just remember to clear the tablist before adding the players, or else some of the other players from the previous world may cross over.
     
  9. What if a player disconnects will they be taken off automatically?

    Also getting a NullPointerException on this line: PlayerList.getPlayerList(p).clearCustomTabs();
     
  10. Offline

    Zombie_Striker

    @Blackwing_Forged
    Can you post the error on the util's page?

    No, it will not be taken off if the player leaves. You will need to account for that by listening to when they quit.
     
Thread Status:
Not open for further replies.

Share This Page