0

I code a hugh Plugin on Spigot 1.16.5 and now i have a problem. I want to set a Tab Prefix and everything works but the Playername is still white.

Picture of the ingame Prefix


    public static void setScoreboard() {

        sb = Bukkit.getScoreboardManager().getNewScoreboard();
        sb.registerNewTeam("000Admin");
        sb.registerNewTeam("001Spieler");

        sb.getTeam("000Admin").setPrefix("§c§lADMIN ► §c");
        sb.getTeam("001Spieler").setPrefix("§b§l§b");



        for (Player all : Bukkit.getOnlinePlayers()) {
            setTeams(all);
        }
    }

    public static void setTeams(Player p) {
        String team = "";

        if (p.hasPermission("province.prefix.admin")) {
            team = "000Admin";
        } else {
            team = "001Spieler";
        }
        sb.getTeam(team).addPlayer(p);
        p.setScoreboard(sb);
    }
}
Moritz L.
  • 9
  • 3

1 Answers1

0

I would not go with the § character at all. If you want colors, use ChatColor enum (not the net.md_5 one!) I would recommend using ChatColor.translateAlternateColorCodes('&', "My message here &cWith color codes!") as this allows you to use the & symbol in your messages as a replacement for §. The other option with ChatColor is to do something like this: ChatColor.RED + "Message in red" + ChatColor.BLUE + " Message in blue"