Nametag = the name above the head. Here is what I want to do. I have 2 players. A and B. I want to set player A sees player B's nametag with red color. And player A sees his own nametag with green color. So player B sees player A's nametag with red color. And player B sees his own nametag with green color. How would I do this? Packets or anything else? Any API can I use?
Here is what I want to do. I have 2 players. A and B. I want to set player A sees player B's name with red color in the tablist. And player A sees his own name with green color in the tablist. So player B sees player A's name with red color in the tablist. And player B sees his own name with green color in the tablist. How would I do this? Packets or anything else? Any API can I use?
Your best, if not only option is to send Scoreboard packets, specifically the team ones. http://wiki.vg/Protocol#Teams You'll either be creating the team for the first time, in which you have mode of the packet as '0' or you're updating the team info (prefix, suffix, etc), in which you have the mode as '1.' You won't necessarily be using the other modes (specifically the removal mode) unless you're removing the teams, but there's really no need since they're just packets, and they're non-existent server-side, and you can just update them to change any info.
I also found these, is it useful? Can you explain it if you have time? https://www.spigotmc.org/threads/scoreboard-tablist-color-help.186042/ https://www.spigotmc.org/threads/help-with-packetplayoutscoreboardteam.278571/
Your MUCH better off figuring this out for yourself. It will make you understand it so much more than just copy pasting code someone gives you here. But as a nudge in the right direction look at some tutorials on protocol lib