Per player nametag and tablist

Discussion in 'Spigot Plugin Development' started by SunnyLo, Jun 15, 2018.

  1. 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?
     
  2. 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?
     
  3. Your best, if not only option is to send Scoreboard packets, specifically the team ones.
    http://wiki.vg/Protocol#Teams

    [​IMG]
    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.
     
  4. Any in-depth tutorial?
     
  5. 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