So I'm trying to drop a player's inventory in front of them and when I try to drop the player's inventory it gives me an illegal argument exception. Code: Code:java for(ItemStack stack : p.getInventory().getContents()){ p.getWorld().dropItem(new Location(p.getWorld(), p.getLocation().getX() - 1, p.getLocation().getY(), p.getLocation().getZ()), stack); } Question in a nutshell, how can I drop an array of items? ItemStack.
try this code: Code:java for (ItemStack itemStack : player.getInventory().getContents()) { if (itemStack != null) { player.getWorld().dropItemNaturally(player.getLocation(), itemStack ); player.getInventory().remove(itemStack ); }}