The following is based on a decompiled version of Minecraft 1.8 using MCP. All method and class names are the ones used in the decompiled version.
The bug
The method public EntityItem dropPlayerItemWithRandomChoice(ItemStack itemStackIn, boolean p_71019_2_)
of the class net.minecraft.entity.player.EntityPlayer
is used to drop items while having a container GUI open or when you get an item but have no space in your inventory.
This happens under multiple circumstances, for example when you press "Q" (or the key you assigned) while having a container GUI open or when you close your inventory while you have items placed in the crafting grid. This is report is about the latter one. In 1.8 all cases except player is pressing "Q" are handled as item was not dropped by player, but in my opinion that is not correct.
Affected situations
Closing GUI
net.minecraft.inventory.Container
(Item in hand)net.minecraft.inventory.ContainerEnchantment
net.minecraft.inventory.ContainerMerchant
net.minecraft.inventory.ContainerPlayer
(2x2 crafting grid)net.minecraft.inventory.ContainerRepair
net.minecraft.inventory.ContainerWorkbench
Using item
net.minecraft.item.ItemBucket
net.minecraft.item.ItemEmptyMap
net.minecraft.item.ItemGlassBottle
Other
net.minecraft.inventory.SlotCrafting
❓net.minecraft.entity.passive.EntityCow
(Milking)
How to reproduce (closing container)
Place an enchanting table
Place a book in your hotbar
Fill all other slots with a different item (e.g. stone); with one stack having more than one item
Open the enchanting table
Place the book in the corresponding slot
Fill the now free slot in your inventory with the spare item from step 3
Close the enchanting table (by pressing
E
orEsc
)
✔ The book is thrown out because there is no space in your inventoryInspect the item entity data
/data get entity @e[type=item,limit=1] Thrower
❌ It has no thrower even though you threw it (passively)
Related issues
is duplicated by
Attachments
Comments


Only checked this for 20w07a for the case described in the (now added) reproduction steps.
Can confirm in 20w49a.
Can confirm in 21w05b.
Can confirm in 21w06a. Video attached.
Can confirm in 21w07a.
Can confirm in 1.16.5 and 21w08b.
Can confirm in 21w11a.
Can confirm in 1.17.

Can confirm in 1.17.1.

Affects 1.18.2