I got the bukkit runnable to run when there are enough players in the queue, but it spams the chat and the time won't decrease. Code (Text): public static int timeUntilStart; Main plugin; public GameCountDown(Main pl){ plugin = pl; } @Override public void run() { timeUntilStart = 60; if(timeUntilStart == 0){ if(Main.WaitingPlayers.size() < Main.minplayers){ plugin.stopCountDown(); for(Player p : Main.WaitingPlayers){ p.sendMessage(Main.msprefix + "§cNot enough players!"); } return; } BBDArena.start(Integer.toString(getArena.getCurrentArena())); BBDArena.assignTeam(Integer.toString(getArena.getCurrentArena())); BaseArena.States = BaseArena.states.STARTED; } if (timeUntilStart % 10 == 0 || timeUntilStart < 0) { for (Player p : Main.WaitingPlayers) { p.sendMessage(Main.msprefix + timeUntilStart + "§dseconds until start!"); break; } } timeUntilStart -= 1; }
You're setting timeUntilStart to 60 every time it's run. It will perpetually be 60, then decrement to 59.
Alright thanks bro, I deleted the timeUntilStart = 60; and changed public static int timeUntilStart = 60; Now the runnable seems to be working properly