mojira.dev
MC-3587

Last use of an anvil causes player to drop their item

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

Linked issues

Comments

Ben Carter

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.

Ezekiel

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.

Trevor Langas

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.

Trevor Langas

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.

Sonicwave

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

Skaijie

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

Avoma

Can confirm in 20w48a.

Jack McKalling

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.

Avoma

Can confirm in 21w05b.

Jack McKalling

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.

Ian Anderson

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. 

windwend

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.

Trevor Langas

[Mod] markderickson

Ulraf

Confirmed

Important

Items

anvil, inventory

Minecraft 1.4.5, Minecraft 1.4.7, Minecraft 1.5, Minecraft 1.5.1, Minecraft 1.5.2, ..., 21w13a, 21w14a, 21w15a, 21w16a, 21w17a

21w18a

Retrieved