[MC-3587] Last use of an anvil causes player to drop their item Created: 21/Nov/12  Updated: 27/Sep/21  Resolved: 05/May/21

Status: Resolved
Project: Minecraft: Java Edition
Component/s: None
Affects Version/s: Minecraft 1.4.5, Minecraft 1.4.7, Minecraft 1.5, Minecraft 1.5.1, Minecraft 1.5.2, Snapshot 13w25c, Minecraft 1.7.4, Minecraft 14w02c, Minecraft 14w03b, Minecraft 14w04a, Minecraft 14w04b, Minecraft 1.7.10, Minecraft 14w30b, Minecraft 14w30c, 1.16.3, 1.16.4 Pre-release 1, 1.16.4 Pre-release 2, 1.16.4 Release Candidate 1, 1.16.4, 20w45a, 20w46a, 20w48a, 20w49a, 20w51a, 21w03a, 1.16.5, 21w05a, 21w05b, 21w06a, 21w07a, 21w08b, 21w10a, 21w11a, 21w13a, 21w14a, 21w15a, 21w16a, 21w17a
Fix Version/s: 21w18a

Type: Bug
Reporter: [Mod] markderickson Assignee: [Mojang] Ulraf
Resolution: Fixed Votes: 11
Labels: anvil, inventory

Issue Links:
Relates
relates to MC-87935 When closing the inventory while hold... Reopened
CHK:
Confirmation Status: Confirmed
Game Mode: Survival
Category:
Items
Mojang Priority: Important

 Description   

Upon using an anvil for the last time before it breaks, taking the output out causes the item to be dropped/thrown.

What I expected to happen was...:
I expected that the item would be placed into my inventory when the anvil breaks.

What actually happened was...:
I removed the new item (without shift-click) causing the anvil to break. As the menu forcefully closes, the item I was holding in the cursor is thrown onto the floor.

Steps to Reproduce:

  1. Use all charges of the anvil.
  2. On the last charge, pick up the new item with a click.
  3. Anvil breaks, causing the menu to close.
    the item is thrown


 Comments   
Comment by windwend [ 27/Sep/21 ]

Seems that this is the way this bug was fixed: items that are held with the cursor when the inventory or any GUI closes, are now transferred directly into the inventory instead of thrown out.

Comment by Ian Anderson [ 08/May/21 ]

I never thought this was a bug. I imagine it as hitting your item with a hammer to forge it, but your anvil breaks when you hit it so it falls to the ground before you can grab it. 

Comment by [Helper] Jack McKalling [ 05/May/21 ]

When the anvil is closed, items still in any of the slots or in the cursor are now correctly placed inside the inventory just like with chests.

Comment by [Mod] Avoma [ 04/Feb/21 ]

Can confirm in 21w05b.

Comment by [Helper] Jack McKalling [ 25/Nov/20 ]

Also works if you start with a "Damaged Anvil" from the creative inventory, and then combine two Sharpness I enchanted books back in survival, a couple of times.
Doesn't happen if you shift-click the output, so it appears that the drop happens because you're holding it in the cursor while the gui is forced closed.

Comment by [Mod] Avoma [ 25/Nov/20 ]

Can confirm in 20w48a.

Comment by Skaijie [ 20/Sep/20 ]

In Bedrock edition the item will be sent back to the inventory instead of being thrown out, perhaps a similar mechanic could also be used

Comment by [Mod] Sonicwave [ 16/Sep/20 ]

Changed the reporter to markderickson, as they have requested it in Discord and the original reporter has been inactive.

Comment by Trevor Langas [ 27/Jul/14 ]

This issue is still active. Tested with 14w30c.
When ever the last use of an anvil is used, it will break and close the inventory menu. <-- That is the issue.
This causes the item you just removed to be dropped/thrown, as you cannot hold an item, with the mouse cursor, when the inventory menu is closed.
The only logical solution I see is to add a forth state to the anvil. aka broken. or to automatically switch to the player's inventory menu, before closing. This way the user can still place the item back into their inventory. It will also prevent the extremely rare chance that the item will get lost (like my first example), when thrown, or stolen by another nearby player.

Comment by Trevor Langas [ 26/Jan/14 ]

This is still an issue, as of 14w04b.
Any item still in hand when using any object will get thrown forward, when the object is destroyed before the player can place it in their inventory.

Comment by [Mod] Ezekiel (ezfe) [ 26/Jan/14 ]

Is this still a concern in the latest Minecraft version 14w04b? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.

Comment by Ben Carter [ 24/Jun/13 ]

Seen this in 1.5.2 multiple times as well, but my anvil wasn't over the Void so I didn't lose what I was working on.

Generated at Sun Jan 12 12:01:43 UTC 2025 using Jira 9.12.2#9120002-sha1:301bf498dd45d800842af0b84230f1bb58606c13.