Solved Making part of plugin sleep for 2 seconds

Discussion in 'Plugin Development' started by Kudze, Sep 20, 2015.

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

    Kudze

    Ok so i'm making plugin on my server and i'm trying to make tnt run plugin and i need somehow stop one part of plugin for couple seconds (when block gets destroyed below you) How to do it?
     
  2. Offline

    Kudze

    BukkitTask task = new ExampleTask(this.plugin).runTaskLater(this.plugin, 20);
    this one?
     
  3. Offline

    justin_393

    new BukkitRunnable() {
    @Override
    public void run() {
    //code to be executed
    }
    }.runTaskLater(plugin, 40L);
     
  4. Offline

    Kudze

    Can someone fully explain me how their methods work and dont just copy paste it?
    @justin_393
     
  5. Use what
    @justin_393 said. .runTaskLater runs the code in the method "run" after a specified amount of time (ticks). The first parameter must be the instance of your plugins main class and the second parameter must be the time in ticks (20 ticks = 1 second)
     
Thread Status:
Not open for further replies.

Share This Page