Rotating Scoreboards?

Discussion in 'Plugin Development' started by russjr08, Nov 5, 2013.

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

    russjr08

    I have a few scoreboards that I want to display to users of the scoreboard. I have the code to display all in their own BukkitRunnables, however I want each scoreboard to display for a total of maybe 5 seconds before moving on to the next? How would I go about doing so?
     
  2. Offline

    MrOAriO

    You must set every time another Scoreboard Title i think ... if you mean this.
     
  3. Offline

    russjr08

    Not sure what you mean by that :/
     
  4. Offline

    CraftBang

    russjr08 you could use something like this timer :
    Code:
     private static int left = 40;
       public static void startTimer() {
     //setscoreboard 1
    new Runnable() {
               public int taskID = Bukkit.getScheduler().scheduleSyncRepeatingTask(Main.plugin, this, 0L, 20L);
               @Override
               public void run() {
                   if (left > 0) {
                       left--;
                       switch (left) {
                           case 35:
    //setscoreboard 2
                               break;
                           case 30:
    //setscoreboard 3
                               break;
                           case 25:
    //setscoreboard 4
                               break;
                       }
                   } else {
                       Bukkit.getScheduler().cancelTask(taskID);
    startTimer();
                   }
               }
           };
       }
    
    It's an infinite loop, so you can just add more cases for more scoreboards :p
     
Thread Status:
Not open for further replies.

Share This Page