Solved Scoreboard problem

Discussion in 'Plugin Development' started by Froshin, May 31, 2013.

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

    Froshin

    Hi.

    I want to use the scoreboard to keep track of what abilities each player will has.

    Code:
    ScoreboardManager manager = Bukkit.getScoreboardManager();
                    Scoreboard board = manager.getNewScoreboard();
               
                   
                    Objective ClassTypeObjective = board.registerNewObjective("Class", "dummy");
                    ClassTypeObjective.setDisplayName("DName");
                    ClassTypeObjective.setDisplaySlot(DisplaySlot.SIDEBAR);
                   
                   
                   
                    Score ClassTypeScore = ClassTypeObjective.getScore(p);
                    ClassTypeScore.setScore(2); 
     
    p.sendMessage("Check.")
    It does say Check, but the objectives doesn't show up nor are they registered when I try

    /scoreboard objectives list


    Any ideas on why?

    Thanks in advance!

    Nevermind, I solved it. I had to to enable the right scoreboard for players.

    for(Player online : Bukkit.getOnlinePlayers()){
    online.setScoreboard(board);
    }

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

Share This Page