How do I do this?

Discussion in 'Plugin Development' started by solymosib10, Jun 25, 2021.

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

    solymosib10

    So, I wrote a rescue bar plugin, where if you right click on a blaze bar you get a block underneath. Now I want that block to disappear after 5 seconds, I guess this could be done with a simple runnabel, I just don't know how. I just started writing this plugin. IntelliJ idea, java.
     
  2. Offline

    KarimAKL

    @solymosib10 You can create an anonymous BukkitRunnable for the task.
    Code:Java
    1. // Set block underneath
    2.  
    3. new BukkitRunnable() {
    4. @Override
    5. public void run() {
    6. // Remove block
    7. }
    8. }.runTaskLater(pluginInstance, 20 * 5);
     
  3. Offline

    davidclue

    @KarimAKL Is there a difference between that and scheduleSyncDelayedTask()?
     
  4. Offline

    KarimAKL

    @davidclue
    Source: https://bukkit.fandom.com/wiki/Scheduler_Programming#BukkitRunnable
     
Thread Status:
Not open for further replies.

Share This Page