-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes on EntityPickupItemEvent not reflected #10065
Comments
While upstream passes the itementity, which intern is used for the event, the item stack passed to the method is used instead of the "updated" one from the item entity. The method also receives a copy of the item entities itemstack, so we don't magically update it with a craft mirror rn either. |
The EntityPickupItemEvent is just wrong right now. It is incorrect to pass the Item (entity) as the thing being picked up because in vanilla, the stack actually being kept by the mob isn't always the full stack in the entity. Piglins, for example, can pickup 1 item at a time from an item entity and the event doesn't give you that context. I think the solution here, is to add an ItemStack field to that event, deprecate getItem() (just to rename it to getSourceItem) and tell people to check the stack instead. |
Expected behavior
Changes done in the event to the item stack associated with the event should be reflected on the actual picked up item.
Observed/Actual behavior
The changes are not reflected and are ignored.
Steps/models to reproduce
Example code: https://code.lewds.de/BQ7OpU
Output showing that even though the item was changed it didnt end up in the inventory
![image](https://private-user-images.githubusercontent.com/46890129/292203151-42ab3f7b-6542-49f9-974a-09f5e0c775dd.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg3MjQ0MzgsIm5iZiI6MTcxODcyNDEzOCwicGF0aCI6Ii80Njg5MDEyOS8yOTIyMDMxNTEtNDJhYjNmN2ItNjU0Mi00OWY5LTk3NGEtMDlmNWUwYzc3NWRkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MTglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjE4VDE1MjIxOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTdhMDAzOTQwYzgzZWIzZWJiNjVjYmM2ODQ3MWU3OGEyMTkzYjhmMWQ2YTM1NTc3YzczMDU5ODcyZTUxYjk0YzImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.Zqupjz9vTFNioAaTPLW4WT7P5C7L5PiRyHriZpZMxQ8)
The whole process is:
Plugin and Datapack List
Only the example plugin above.
Paper version
1This server is running Paper version git-Paper-318 (MC: 1.20.2) (Implementing API version 1.20.2-R0.1-SNAPSHOT) (Git: 9271ee7)
You are running the latest version
Previous version: git-Paper-196 (MC: 1.20.1)
Other
No response
The text was updated successfully, but these errors were encountered: