spigot get online players code example
Example: bukkit for every player
for(Player all : Bukkit.getServer().getOnlinePlayers())
{
all.something(something)
}
for(Player all : Bukkit.getServer().getOnlinePlayers())
{
all.something(something)
}