I spawn an item with world.dropItem() or dropItemNaturally() (tried both, same result). I set the pickUpDelay to 0. The item is spawned in just the way it should. However, when I try to pick it up, it wont let me. PlayerPickUpItemEvent is not called. I can pick up any other item, on which PlayerPickUpItemEvent IS called. I have also tried Code: @EventHandler(priority = EventPriority.MONITOR) public void a(ItemSpawnEvent event) { event.getEntity().setPickupDelay(0); } Which is called an executed and everything, but doesn't make a difference for the items spawned with dropItem().
@CodePlaysMinecraft :O sorry, thanks for pointing it out... I gues I need some rest 0_0 So the above post goes to @Anrza
Code: ItemStack is = new ItemStack(Material.IRON_SPADE); is.setAmount(entity.getMetadata("b").get(0).asInt()); ItemMeta im = is.getItemMeta(); im.setDisplayName("a"); is.setItemMeta(im); Item i = entity.getWorld().dropItem(entity.getLocation(), is); String c = ((Entity) ((Projectile) entity).getShooter()).getUniqueId().toString(); i.setMetadata("owner", new FixedMetadataValue(SiegeHardCode.plugin, c)); Nothing weird in there. Bump EDIT by Moderator: merged posts, please use the edit button instead of double posting.
@Anrza Is there any errors when the plugin is loaded of when the item is dropped? If so please post it.
@Anrza You said you set the pickup delay to 0? Try removing that and see if you can pick up the item, that could be your problem.
I only set the pickUpDelay to 0 in order to make sure there was no ridiculously high delay preventing me from picking it up. Couldn't pick it up before I added it either.