Is there anyone that knows how to set a player's above head nametag with a color? After some search with absolute no clue, this is what I got, but it didn't work. Code: public static Team sc; Code: public static void Nametag(Player p, String cc) { try { Scoreboard sb = Bukkit.getScoreboardManager().getMainScoreboard(); Team c = sb.getTeam(p.getName()); if (c == null) { c = sb.registerNewTeam(p.getName()); } c.setPrefix('ยง' + cc); c.addPlayer(p); p.setScoreboard(sb); sc = c; } catch (NullPointerException localNullPointerException) {} } I've heard of packets, but never used them. Help is appreciated as always! Thanks, -Fan
@fanofrods Check out TagAPI. I'm pretty sure that's what it's called. @md_5 made it. I haven't used it since like a year ago, but it should work.
The function is called setCustomName() I think. You can une chat color properties on it. I know it work on living entities, but I never tested it on player. Buy like @Hawktasard said, tagAPI works fine
setCustomName() does not work for players. I heard something about a scoreboard API in Bukkit that lets you do it. Any idea?
The scoreboard can be display under a player's name. But it won't override it. So you will have both, the name of the player plus the one you want to display EDIT by Moderator: merged posts, please use the edit button instead of double posting.
TagAPI doesn't work with 1.8 I think + Some people says it's possible to use the new scoreboard bukkit API for nametags
@fanofrods Create a team. Then set the prefix of the team to a color. Add players to the team, any player on the team can see the color above your head.