Thursday, 15 March 2012

plugins - (Solved) How can I drop player inventory? -



plugins - (Solved) How can I drop player inventory? -

i kinda stuck making plugin... code have:

player player = (player)event.getplayer(); itemstack item = new itemstack( /* player.getinventory() */ /* problem here how drop items or in inventory (some items might have enchantments!) */); world world = player.getworld(); world.dropitem(player.getlocation(), item);

does know how drop items in inventory? items have enchantments , cannot removed while dropping.

what iterating on players inventory , using dropitemnaturally?

for (itemstack itemstack : player.getinventory()) { player.getworld().dropitemnaturally(player.getlocation(), itemstack); }

plugins bukkit inventory items

No comments:

Post a Comment