PlayerPickItemEvent should be an InventoryEvent
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 12.7k
- Forks
- 3.5k
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 11
Description
Expected behavior
The relevant packet for PlayerPickItemEvent (ServerboundPickItemPacket) is used by some mods to quick move items through the inventory to the player's hand. This event should extend InventoryEvent - it has all relevant Inventory context to provide the necessary information for an InventoryEvent.
Observed/Actual behavior
When sending a ServerboundPickItemPacket on slot 9, this event will fire and cause inventory manipulation without triggering any InventoryEvent (such as an InventoryClickEvent). This event also does not extend InventoryEvent, making it semi-invisible to Javadocs browsing for trying to handle Inventory-related exploits and bugs.
Steps/models to reproduce
- Implement a system utilizing InventoryEvents to prevent players from moving items
- Trigger a ServerboundPickItemPacket on a relevant slot
- PlayerPickItemEvent will fire, but no InventoryEvents will fire. The inventory will, however, still be mutated.
Plugin and Datapack List
[22:05:57 INFO]: Server Plugins (21):
[22:05:57 INFO]: Paper Plugins:
[22:05:57 INFO]: - BKCommonLib
[22:05:57 INFO]: Bukkit Plugins:
[22:05:57 INFO]: - Essentials, FastAsyncWorldEdit, GSit, helper, helper-sql, HuskyScreen, LuckPerms, Multiverse-Core, Multiverse-NetherPortals, packetevents
[22:05:57 INFO]: *PlasmoDynamicSources, PlasmoVoice, PlugManX, ProtocolLib, pv-addon-lavaplayer-lib, spark, SubserverAdditions, Train_Carts, ViaVersion, WorldGuard
[22:06:09 INFO]: There are 2 data pack(s) enabled: [vanilla (built-in)], [file/bukkit (world)]
[22:06:09 INFO]: There are no more data packs available
Paper version
Unknown version
Previous version: git-Paper-280 (MC: 1.20.2)
Note: This paper fork only has small alterations for how Maps are updated and does not have any sweeping changes
Other
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating PlayerPickItemEvent, InventoryEvent, and the handling path for ServerboundPickItemPacket. Compare the event hierarchy and available inventory context, then use the listed reproduction steps to verify that picking an item is represented as an InventoryEvent and that inventory manipulation is no longer invisible to InventoryEvent handlers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100