Need a Clock

Discussion in 'Plugin Development' started by MnMaxon, Jul 6, 2012.

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

    MnMaxon

    I'm new to java, and I want to make a clock that counts down.
    I don't need to know how to print in on screen or anything, I just need to have a clock that can run.
    My problem is that I don't know how to time things.
    If anyone could help me, or show me a video, I would greatly appreciate it.
     
  2. Code:java
    1. int count = 10;
    2.  
    3. Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
    4. @Override
    5. public void run() {
    6. count--;
    7. if (count >= 0) {
    8. System.out.println(count + " Seconds left.");
    9. }
    10. }
    11. }, 20L, 20L);
     
    MnMaxon likes this.
  3. Offline

    MnMaxon

    Code:java
    1.  
    2. Thank you
     
Thread Status:
Not open for further replies.

Share This Page