Spigot Development Help

Status
This thread has been locked.

_gr1zzLY

Cybersecurity Software Engineer
Premium
Feedback score
1
Posts
50
Reactions
11
Resources
0
Hi, all. I've been trying to figure out a way to set with the buikkit-api for scoreboards to be able to make unique Strings under the name as shown in the attached file. But the problem i am having it seems as if i am unable to make them unique per player, is there a possible solution to this?

I am starting to wonder if i do not understand how the scoreboards work, as it seems i would have to do something with NMS?

Thanks ~grizz
 

Attachments

  • 2019-01-19_16.41.38.png
    2019-01-19_16.41.38.png
    360.1 KB · Views: 24
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.

_gr1zzLY

Cybersecurity Software Engineer
Premium
Feedback score
1
Posts
50
Reactions
11
Resources
0
Code:
public static void setBoard(Player player){

    ScoreboardManager manager = Bukkit.getScoreboardManager();
    FPlayer fPlayer = FPlayers.getInstance().getByPlayer(player);
    Scoreboard board = manager.getNewScoreboard();

    objectives.put(player.getUniqueId(), board.
            registerNewObjective(player.getName(), "dummy"));

    objectives.get(player.getUniqueId()).
            setDisplayName(fPlayer.getTag());

    objectives.get(player.getUniqueId()).
            setDisplaySlot(DisplaySlot.BELOW_NAME);

    scoreboards.put(player.getUniqueId(), board);

    player.setScoreboard(scoreboards.get(player.getUniqueId()));
}

currently this is how i was trying to set the name under each person. But it seems when i tested it with two people the other person sees the their own name. I call this onJoin method.
 

_gr1zzLY

Cybersecurity Software Engineer
Premium
Feedback score
1
Posts
50
Reactions
11
Resources
0
If you want user to see their own name you should be able to use Player.getName // getDisplayName
I know that... that wasn't my question.
 
Status
This thread has been locked.
Top