spigot run runnable later code example
Example 1: spigot run task later
// 20L = 1 Second
Bukkit.getScheduler().runTaskLater(main, new Runnable() {
public void run() {
System.out.println("Plugin has been enabled for 5 seconds!");
}
}, 100L);
Example 2: bukkit scheduled task
Bukkit.getScheduler().scheduleSyncRepeatingTask(instance, new Runnable() {
@Override
public void run() {
//Your Code Here
}
}, 0L, 20L);