I can only see my colored nametag?

Discussion in 'Spigot Plugin Development' started by FroZenKeyboard, May 3, 2017.

  1. Does anyone know how i can fix that? I can see my colored nametag, but others don't..
     
  2. Can you please show us your code, so we can help you easier?
     
  3. Code (Text):
                if(user.inGroup("Eier")) {
                    owner.addPlayer(player);
                }
                Team admin = s.registerNewTeam("Admin");
                admin.setPrefix("§4§l");
                if(user.inGroup("Admin")) {
                    admin.addPlayer(player);
                }
                Team mod = s.registerNewTeam("Mod");
                mod.setPrefix("§c");
                if(user.inGroup("Moderator")) {
                    mod.addPlayer(player);
                }
               
                Team dev = s.registerNewTeam("dev");
                dev.setPrefix("§2§l");
               
                Team bygger = s.registerNewTeam("bygger");
                bygger.setPrefix("§2");
                if(user.inGroup("Leder")) {
                    bygger.addPlayer(player);
                }
                Team vip = s.registerNewTeam("vip");
                vip.setPrefix("§5");
                if(user.inGroup("VIP")) {
                    vip.addPlayer(player);
                }
                Team spiller = s.registerNewTeam("spiller");
                spiller.setPrefix("§3");
                if(user.inGroup("default")) {
                    spiller.addPlayer(player);
                }
    It sets the nametag, but only i can see it. Anyone else can't..
     
  4. This is, because you only set the Scoreboard for yourself. In order that other players can see this, you have to update the scoreboard for every online players. This can be done with this method:
    Code (Text):

    for(Player players : Bukkit.getOnlinePlayers() {
    players.setScoreboard(s);
    }
     
     
    • Agree Agree x 1
  5. I use all the players on the server, still not working. Can it be that the teams aren't registered in the /scoreboard teams list? But anyways, i get added to a scoreboard team. Cause my nametag is not white.
     
  6. How do you show it to all players? Code please.
     
  7. for(Player online : Bukkit.getOnlineplayers()) {
    online.setScoreboard(s);
    }
    That's how i do it