I am writing a minigame for Minecraft and have a problem with the schedule. I don't know how to stop the schedule. Please tell me how I can stop running this loop / Timer / Schedule:
public void WarteTimer() {
count = Bukkit.getScheduler().scheduleSyncRepeatingTask(
(Plugin) this,
new Runnable() {
@Override
public void run() {
if (countdown > 0) {
Bukkit.broadcastMessage("ยง6Countdown : " +countdown);
countdown--;
} else {
Game();
//Bukkit.getScheduler().cancelTask(count);
//countdown = 5;
}
}
},
0L,
20L);
}