bukkit scheduler repeating task code example
Example 1: spigot repeating task
Bukkit.getScheduler().scheduleSyncRepeatingTask(plugin, new Runnable() {
@Override
public void run() {
Bukkit.broadcastMessage("This message is shown immediately and then repeated every second");
}
}, 0L, 20L);
Example 2: bukkit scheduler delay task
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
@Override
public void run() {
Bukkit.broadcastMessage("This message is shown after one second");
}
}, 20L);