Per Player Scoreboard

Discussion in 'Spigot Plugin Development' started by iNoXs, Jun 28, 2016.

  1. Hi i try to do a scoreboard with a timer but when 2 player start the timer this is displayed :
    [​IMG]
    [​IMG]
    i try a lot of things but idk ^^

    Thanks for help
     
  2. the task should be out from in-game player loop :p, also make sure you don't change the timer when someone join
     
  3. i forgot my code :
    Code (Text):
        public void setBoard(Player p) {
            objective.setDisplaySlot(DisplaySlot.SIDEBAR);
            Score score = objective.getScore("§7§m§l-----------------------");
            score.setScore(0);
            p.setScoreboard(board);
        }

        public void updateScore(Player p) {
            if (Main.protect.get(p.getName()) != null) {
                objective.setDisplayName("§6OzrilHCF §cPvPTimer §b" + Main.protect.get(p.getName()));
                p.sendMessage(""+Main.protect.get(p.getName()));
            } else {
                p.setScoreboard(Bukkit.getScoreboardManager().getNewScoreboard());
            }

        }
    And i update the score in the task
     
    #3 iNoXs, Jun 28, 2016
    Last edited: Jun 28, 2016
  4. You could store the players and their scoreboards in a hashmap, and get their scoreboards from there. Then when setting there scoreboard, just set it to the one you received from the hashmap.