Scoreboard Objective Order problems

Discussion in 'Plugin Development' started by IcyRelic, Feb 5, 2014.

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

    IcyRelic

    The scoreboard is spose to look like this

    [​IMG]

    but if i reload it SOMETIMES

    it will look like this

    [​IMG]

    any fixes?


    here is my code

    Code:java
    1. public void onEnable(){
    2. getServer().getPluginManager().registerEvents(new join(this), this);
    3.  
    4.  
    5. ScoreboardManager manager = Bukkit.getScoreboardManager();
    6. Scoreboard board = manager.getNewScoreboard();
    7.  
    8. Objective objective = board.registerNewObjective("LS", "dummy");
    9. objective.setDisplaySlot(DisplaySlot.SIDEBAR);
    10. objective.setDisplayName("Scoreboard");
    11.  
    12. Score score = objective.getScore(Bukkit.getOfflinePlayer(ChatColor.GREEN + "Time:"));
    13. score.setScore(1); //Example
    14. Score score1 = objective.getScore(Bukkit.getOfflinePlayer(ChatColor.GREEN + ""+DescParseTickFormat.format12(getServer().getPlayer("IcyRelic").getPlayerTime())));
    15. score1.setScore(1); //Example
    16. for(Player online : Bukkit.getOnlinePlayers()){
    17. online.setScoreboard(board);
    18. }
    19.  
    20. }
     
  2. Offline

    mazentheamazin

    Icyrelic
    Both of their values are 1. So use:
    Code:java
    1. score.setScore(2);

    And that should fix it.
     
  3. Offline

    IcyRelic

    Thanks working good the order is staying

    [​IMG]
     
Thread Status:
Not open for further replies.

Share This Page