1Bukkit.getScheduler().scheduleSyncRepeatingTask(plugin, new Runnable() {
2 @Override
3 public void run() {
4 Bukkit.broadcastMessage("This message is shown immediately and then repeated every second");
5 }
6}, 0L, 20L); //0 Tick initial delay, 20 Tick (1 Second) between repeats
1int taskID;
2public void startCountdown(){
3 taskID = Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(this,new Countdown(),20L,20L);
4}
5public void stopCountdown(){
6 Bukkit.getServer().getScheduler().cancelTask(taskID);
7}
8// 20L = 1 Second