Minecraft bukkit code to run all players?

ma
- in Plugins
9

I'm writing a 1.7 minecraft plugin and I want everyone to clear their inventory. For only one player, the code looks like this for me: "player.getInventory (). Clear ();" instead of the "player." I would like to have "AllPlayers.", what do I have to do, so that the inventory is cleared by all players?

Co

For (Player p: Bukkit.getServer (). GetOnlinePlayers ()) {
//code
}

Ap

For (Player allPlayers: Bukkit.getOnlinePlayers ()) {
allPlayers.getInventory (). Clear ()
}

Cr

Why do not you use the MC command "/ clear @a"?

ma

Because this is not possible in the 1.7: /

ma

Thanks a lot

ma

Could you write jtz as an example to this, as I z.b. The inventory of the players can clear? Would be very nice just completely stupid xD

Cr

Why are you still playing in the 1.7?

Co

P.getInventory () clear ().

ma

Many Thanks. I still thought i was desperate xD