Need Help :<

Ivan

Suspended
Suspended
So..
I am making a plugin which needs to filter players with permission now my current code is:
Bukkit.getOnlinePlayers().stream().filter(p -> p.hasPermission(“test.test”)).forEach(p-> p.sendMessage(“Hey”));

and it gives me an error and it mainly doesn’t work
Any other way to do this?

I have also tried using Bukkit.broadcast(“he”, Server.Broadcast_Channel_Administrative)
But it only broadcasts to ops
 

Ivan

Suspended
Suspended
\/


I always use this:
Java:
for(Player player : Bukkit.getOnlinePlayers()){
    if(player.hasPermission("test.test")) {
        player.sendMessage("Hey");
    }
}
But Bukkit.getOnlinePlayers().stream().filter(p -> p.hasPermission(“test.test”)).forEach(p-> p.sendMessage(“Hey”)); works fine for me.
I’ll try this thanks
 
Top