Possible item loss when cancelling PlayerDropItemEvent
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
Assuming a player stands inside a pile of dropped items, then starts moving an item in his inventory with his cursor and thereby filling the empty slot with any of the dropped items. If the player now clicks outside his inventory to drop the cursor item, the event should get cancelled and the item should remain attached to the cursor.
Observed/Actual behavior
When clicking outside the inventory the item will simple get deleted if the players inventory is full.
Steps/models to reproduce
- Cancel all PlayerDropItemEvents.
- Stand in a pile of dropped items with a full inventory.
- Move an item in your inventory with your cursor.
- Click outside the inventory in order to drop the item.
- Watch the item being deleted.
Plugin and Datapack List
Just a test plugin cancelling the event.
Paper version
This server is running Paper version git-Paper-283 (MC: 1.18.2) (Implementing API version 1.18.2-R0.1-SNAPSHOT) (Git: f8e8d6c)
You are running the latest version
Previous version: git-Paper-277 (MC: 1.18.2)
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 reproducing the issue on Paper git-Paper-283 (MC 1.18.2) with a test plugin that cancels all PlayerDropItemEvents, following the five steps in the report. Trace the inventory drop and PlayerDropItemEvent handling involved in the full-inventory case; done means the cursor item is retained when the event is cancelled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100