Scoreboard question - different sidebar for each player?

Discussion in 'Plugin Development' started by WauloK, Jun 15, 2015.

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


    Is it possible for each player to have a different scoreboard or does it show the same board for everyone?

    I wrote a plugin and created a new team for each player. One player joins and it shows two stats for them, but when a second player joins the game, it flickers between the two scores on both screens.
  2. Yes.

    Can we see the code?
  3. Offline


    I expect I need a different object per player and add it to that or something.

            //Set up Scoreboard
            Scoreboard board = InsanityRun.board;
            Team team = board.registerNewTeam(playerName);
            InsanityRun.objective.setDisplayName(ChatColor.WHITE + "Insanity Run : " + ChatColor.GREEN + playerName);
            Score score = InsanityRun.objective.getScore(ChatColor.YELLOW + "Coins:");
            Score time = InsanityRun.objective.getScore(ChatColor.LIGHT_PURPLE + "Time:");
                            Score score = InsanityRun.objective.getScore(ChatColor.YELLOW + "Coins:");
    Maybe the sidebar can only be the same for everyone.
    Last edited by a moderator: Jun 16, 2015
  4. Offline


    If you want each player's scoreboard to show different content, like coins, then you'll have to make a separate scoreboard for every single player and update them individually to show the right content for each player. Otherwise you can assign the same scoreboard object to all players, but then they will all see the same exact thing, making dynamic stats like coins impossible.
  5. Offline


    So adding them all as different teams doesn't give them a different scoreboard?

    Should this be a different board for each player?

  6. You have to create a new scoreboard for each palyer, you're just using the same.
    Scoreboard board = Bukkit.getScoreboardManager().getNewScoreboard();
  7. Offline


    Thanks, guys! Got it all sorted :)
Thread Status:
Not open for further replies.

Share This Page