I need to repeat a task every 5 seconds in java, I'm creating a minecraft bukkit / spigot Plugin, so doing it with Java or using the bukkit api would both work great.
Code:
public void onEnable(){
getLogger().info("TBC Enabled");
//~~ the statement from here till the next note is what I want to happen every 5 seconds
for (Player player : Bukkit.getOnlinePlayers()) {
player.sendMessage("N/A");
}
//~~ end of statement I want to repeat every 5 seconds
}
Thanks for the help!