📜  spigot 重复任务 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:08.334000             🧑  作者: Mango

代码示例2
int taskID;
public void startCountdown(){
    taskID = Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(this,new Countdown(),20L,20L);
}
public void stopCountdown(){
    Bukkit.getServer().getScheduler().cancelTask(taskID);
}
// 20L = 1 Second