BlockDropItemEvent is sometimes not correct
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
Items not from block breaks to not be included in the dropped items in BlockDropItemEvent
Observed/Actual behavior
When various circumstances are met, extra items can appear inside the list of dropped items when listening to a BlockDropItemEvent. Some examples, but not an exhaustive list, are laid out below.
Steps/models to reproduce
The following places to drop items will have them appear in BlockDropItemEvent
- When listening to CreatureSpawnEvent with SpawnReason.SILVERFISH_BLOCK
- When listening to tool durability changes and one occurs because of a block break
- Listening to the item used stat changes for mining blocks
- Listening to the block mined stat changes
- Listening to the food exhaustion event with ExhaustionReason.BLOCK_MINED
Plugin and Datapack List
None
Paper version
This server is running Paper version git-Paper-"9cab01e" (MC: 1.18.1) (Implementing API version 1.18.1-R0.1-SNAPSHOT) (Git: 9cab01e)
You are running the latest version
Previous version: git-Paper-"0d5fd28" (MC: 1.18.1)
Other
This is caused by the captureDrops List stored on Level that when non-null, prevents ItemEntities from being added to the world.
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 tracing the captureDrops List on Level and how ItemEntities are added to the world. Reproduce the issue using the listed event listeners and confirm that items not produced by block breaking are excluded from BlockDropItemEvent's dropped-items list.
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