Chest Cooldown

Discussion in 'Plugin Development' started by HariHD, Feb 12, 2014.

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

    HariHD

    Hey!

    How would I add a cool down for when a player opens a chest. I am using an InventoryOpenEvent and it adds items but I want it to add items every 60 seconds. How would I do that?

    Thanks for your time,
    Hari
     
  2. Offline

    MOMOTHEREAL

  3. Offline

    EnderTroll68

    Code:java
    1. Bukkit.getServer().getScheduler().runAsyncTaskLater(this, new Runnable() {
    2. @Override
    3. public void run() {
    4. // do sexy stuffs here
    5. }
    6. }
    7. , 1200L);


    That will do stuffs every 60 seconds. Hope it helps!
     
Thread Status:
Not open for further replies.

Share This Page