Scoreboard Countdown Help.

Discussion in 'Plugin Development' started by ChrisStarr32, Apr 15, 2014.

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

    ChrisStarr32

    Code:java
    1. Scoreboard board = Bukkit.getServer().getScoreboardManager().getNewScoreboard();
    2. board.registerNewObjective("test", "dummy").setDisplaySlot(DisplaySlot.SIDEBAR);
    3. Bukkit.getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
    4. int temps = pretime;
    5. int minutes = (int) Math.floor(temps / 60);
    6. int seconds = temps % 60;
    7. public void run() {
    8. temps--;
    9. ???.setDisplayName(ChatColor.GREEN + p1 + ChatColor.GRAY + " vs. " + ChatColor.GREEN + p2 + " : " + minutes + ":" + seconds);
    10.  
    11. }
    12.  
    13. }, 1L, 1L);
    14. }

    There is my code. The point of "???" is where I dont know what to do. How can I tie into the top scoreboard thingy. Also am I doing this all right?

    Thank You!
    Chris
     
  2. Offline

    Dahwn

    ChrisStarr32
    Just do it with some more lines and it gets easier to understand:
    Code:java
    1. ScoreboardManager sm = Bukkit.getServer().getScoreboardManager();
    2. Scoreboard board = sm.getNewScoreboard();
    3.  
    4. Objective score = board.registerNewObjective("test", "dummy");
    5. score.setDisplayName("Your Displayname here");
    6. score.setDisplaySlot(DisplaySlot.SIDEBAR);

    I hope you know how to set scores ^^

    -Dahwn
     
  3. Offline

    ChrisStarr32

    Thank you! Yes Ik!
    Was just a little tired I guess
     
Thread Status:
Not open for further replies.

Share This Page