Update tab list for a Player?
ColinTimBarndt opened this issue ยท 2 comments
Hello!
I am developing a plugin and I have to update the player list for a specific player. nte.updatePlayer()
updates just the name of a player for all players. That's not what I want.
Super late reply - but to all those who see this in the future:
NametagEdit will not work out of box for this request. The manager would need to be rewritten to keep track of a different set of ScoreboardTeamObjectives per player. This is out of the scope of NametagEdit's default functionality. However, the code can be retrofitted by creating a new NametagManager instance per player, and utilizing the setNametag and sendTeams methods. Do note this requires a considerable amount of memory and would require good memory management.
I fount the private method sendTeams that should send the packets, but it's not working...
I think it's not sending the scoreboard, just the teams..
try{
NametagManager m = NametagEdit.getPlugin(NametagEdit.class).getManager();
Method sendTeams = NametagManager.class.getDeclaredMethod("sendTeams", Player.class);
if(!sendTeams.isAccessible())sendTeams.setAccessible(true);
sendTeams.invoke(m, player);
} catch (Exception e) {
e.printStackTrace();
}