I'm currently programming a game mode; In the tablist, the names are displayed in the color of the respective team. I arranged the whole thing with teams. But now I want to see the kills of the respective player in front of each name in the tablist. For example, when I'm all blue in the team
sb.getTeam ("blue"). SetPrefix ([my method for kills from individual players] + "§9")
the same number is displayed for everyone in the blue team. So now back to the question: How does everyone get an individual prefix with their kills?
With the SetPrefix function you can create a prefix for the entire team.
That means, even if you only have the player in your method, it will be made judgmental for your entire team.
Instead of
sb.getTeam ("blue"). SetPrefix ([my method for kills from individual players] + "§9")
Do you have to find a function that selects the player in the blue team e.g.
sb.getTeam ("Blue"). GetPlayer ("Testplayer"). SetPrefix (your method)
Of course the code is not correct. You have to adjust the function.
I've been looking for something like that but haven't found anything where you can give a single player from the team a prefix.
If there's such a thing, it would be nice if someone said it.
https://bukkit.org/threads/change-scoreboard-team-player-name.466552/
That should help you. It's not the same, but there's a feature below that might help
sb.getPlayerTeam (p.getPlayer ()). SetPrefix ("KILLS HERE");