CMD_Reload:
In addition, the function in lines 23 and 33 is otherwise only output if at least one player is on the server, which is why I had to query whether there are players on the server or not, so that the countdown in the console is also output without a player.
if (Bukkit.getOnlinePlayers (). Size ()> = 1) {
…
} else if (Bukkit.getOnlinePlayers (). Size () == 0) {
…
}
And where is the problem? What is the question?
for (Player all: Bukkit.getOnlinePlayers ()) {
if (all.hasPermission ("zz.see.reload") &&! All.isOp ()) {
Bukkit.broadcastMessage (Main.Main.pre + "§aReload complete.");
}
}
Here you iterate over all players and output this message for each player for whom the condition is true.
What should happen then?
Should the loop be canceled after the first time? Then take a break; there:
for (Player all: Bukkit.getOnlinePlayers ()) {
if (all.hasPermission ("zz.see.reload") &&! All.isOp ()) {
Bukkit.broadcastMessage (Main.Main.pre + "§aReload complete.");
break;
}
}
Good to know that there's still a break; gives Der1Streber😅
I'm glad I could help you.