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?
For (Player p: Bukkit.getServer (). GetOnlinePlayers ()) {
//code
}
For (Player allPlayers: Bukkit.getOnlinePlayers ()) {
allPlayers.getInventory (). Clear ()
}
Why do not you use the MC command "/ clear @a"?
Because this is not possible in the 1.7: /
Thanks a lot
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
Why are you still playing in the 1.7?
P.getInventory () clear ().
Many Thanks. I still thought i was desperate xD