-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Minor
-
None
-
Affects Version/s: None
-
None
-
git-Spigot-379750e-eaf0bac
-
Yes
I noticed when fiddling around with some code, that the ItemStack can't be changed in an ItemPickupEvent.
Test code:
@EventHandler private void onDrop(EntityPickupItemEvent event) { Item item = event.getItem(); item.setItemStack(new ItemStack(Material.DIAMOND)); }
When this is fired, nothing happens.
Digging thru the code where this event is called, I noticed there's a local field for ItemStack. At the beginning of the pickup method, the field is set and never updated after the events.
Including a tester plugin if you wish to test.
All you need to do is drop any item, and attempt to pick it up, it SHOULD be changed to a DIAMOND but it is not.
I'm going to work on a PR that can fix this issue.