Ok so first of what i am trying to do.
I am trying to use the vanilla scoreboard to display information to a specific player. This is for a server side mod so i cant just access the scoreboard client side.
I have found a way to do this but its going to be a little tricky to implement so before i get started i want check if anyone knows a better way.
After digging through the scoreboard code i have found that i can do this using the following packets.
Sends the scoreboard objective to the client
S3BPacketScoreboardObjective(scoreObjective, 0)
Displays the objective in the sidebar
S3DPacketDisplayScoreboard(1, scoreObjective)
Updates a spacific score in the objecting.
S3CPacketUpdateScore(score, 0)
Working example
The problem i encountered is if i use S3BPacketScoreboardObjective to add an objective that already exists or remove one that dose not exist it crashes the client.
This means i am going to have to come up with a tracking system to keep track of what objective each player currently has displayed and make sure i dont remove or add an objective that already exists. It would also have to keep track of when a player relogs.
Edit: On second thought i only need to send the player one objective which i can send on login. Then i can just change the name, contents and visibility of that objective as needed.