Scoreboard - Gems

Discussion in 'Plugin Development' started by MissGaby, Mar 26, 2014.

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

    MissGaby

    Greetings,
    I am in the process of creating a scoreboard which displays the amount of Gems you obtained during a match. The current code is:
    Code:
        public static void displayPlayerScore() {
            objective.setDisplaySlot(DisplaySlot.BELOW_NAME);
            objective.setDisplayName("Gems");
     
            for(Player online : API.inGame){
                Score score = objective.getScore(online);
                score.setScore(Utils.playerScore.get(online));
                online.setScoreboard(board);
            }
     
        }
     
        public static void updateScore() {
            for(Player p : API.inGame){
                Score local = objective.getScore(p);
                local.setScore(Utils.playerScore.get(p));
                p.setScoreboard(board);
                p.sendMessage("Score: " + local.getScore());
            }
        }
    When the player receives the message is displays the correct amount of gems, but I am assuming it doesn't actually update the player's score. Does anyone know why this is happening?
     
  2. Offline

    Mysticate

    You're "assuming?"
     
  3. Offline

    MissGaby

    Yes, because I have checked if it changed the score, which it did because it is sending a player the message with the correct amount of gems. The scoreboard however doesn't change. So I am assuming the scoreboard doesn't update.
     
  4. MissGaby
    Are you sure you're updating the scoreboard score after you give the player their gems?
     
  5. Offline

    MissGaby

    It triggers the update method right after they picked up the gem, so yes :). Any solutions?

    Anyone?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 7, 2016
Thread Status:
Not open for further replies.

Share This Page