Development Assistance Giving player setScoreboard(getScoreboard()) for a scoreboard "breaks" main scoreboard

Discussion in 'Plugin Help/Development/Requests' started by xDeeKay, Jun 6, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    xDeeKay

    I have 2 scoreboards, one which I create when the server starts using:
    Code:
    Scoreboard scoreboard = Bukkit.getScoreboardManager().getNewScoreboard();
    and the other is the main scoreboard for the server, which I get using:
    Code:
    Scoreboard main = Bukkit.getScoreboardManager().getMainScoreboard();
    The main scoreboard isn't used for the scoreboard itself, I merely add 8 teams to it when the server starts, if they don't already exist. As for the other scoreboard, I add objectives to it and add and remove scores on the go.

    My problem arises when I give players this when they log in:
    Code:
    player.setScoreboard(getScoreboard());
    This gives that player "permission" to see the scoreboard I've created, however it seems whoever has this is then unable to see players prefixes (colours in their name) from the main scoreboard. As soon as I remove that section of the join listener, the player is then able to see the team prefixes from the main scoreboard.

    If I would take a guess, it would seem like setting a players scoreboard overrides the main scoreboard, therefor anything happening in the main scoreboard isn't seen by players with the other scoreboard.

    Any idea on how to combat this issue?
     
Thread Status:
Not open for further replies.

Share This Page