Run something every hour

Discussion in 'Plugin Development' started by Jozeth, Jun 13, 2013.

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

    Jozeth

    I want to check a 'System.currentTimeMillis()' which is saved then after 1 hour has past I want it to run something.

    Any ideas on how to do this?
     
  2. Use a repeating task
     
  3. Code:java
    1. Bukkit.getScheduler().runTaskLater(plugin, new Runnable()
    2. {
    3. @Override
    4. public void run()
    5. {
    6. // Your code
    7. }
    8. }, 20 * 60 * 60);


    Explaining 20 * 60 * 60:
    20 ticks (equal to 1 seconds) * 60 seconds * 60 seconds = 1 hour in ticks.

    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