[MC-1040] Tools with unbreaking enchantment break, disappear from slot then reappear Created: 28/Oct/12  Updated: 20/Oct/16  Resolved: 20/Oct/16

Status: Resolved
Project: Minecraft: Java Edition
Component/s: None
Affects Version/s: Minecraft 1.4.2, Minecraft 1.4.5, Minecraft 1.4.6, Minecraft 1.4.7, Snapshot 13w04a, Minecraft 1.5, Snapshot 13w11a, Minecraft 1.5.1, Minecraft 1.5.2, Minecraft 1.6.1, Minecraft 1.6.2, Minecraft 13w39b, Minecraft 13w42b, Minecraft 13w43a, Minecraft 1.7.1, Minecraft 1.7.2, Minecraft 1.7.4, Minecraft 14w02b, Minecraft 14w02c, Minecraft 14w03b, Minecraft 14w04a, Minecraft 14w04b, Minecraft 14w06b, Minecraft 14w07a, Minecraft 14w08a, Minecraft 1.7.9, Minecraft 14w18b, Minecraft 1.7.10, Minecraft 14w34d, Minecraft 1.8, Minecraft 1.8.1-pre3, Minecraft 1.8.8, Minecraft 15w33b, Minecraft 15w47c, Minecraft 1.8.9, Minecraft 15w51b, Minecraft 16w02a, Minecraft 16w03a, Minecraft 1.9 Pre-Release 1, Minecraft 1.9, Minecraft 1.9.1 Pre-Release 3, Minecraft 1.9.2, Minecraft 1.9.3 Pre-Release 3, Minecraft 1.9.4, Minecraft 16w20a, Minecraft 16w21a, Minecraft 16w21b, Minecraft 1.10 Pre-Release 1, Minecraft 1.10 Pre-Release 2, Minecraft 1.10, Minecraft 1.10.1, Minecraft 1.10.2, Minecraft 16w32a, Minecraft 16w32b, Minecraft 16w33a, Minecraft 16w35a
Fix Version/s: Minecraft 16w43a

Type: Bug
Reporter: Darren Hiles Assignee: Maria Lemón
Resolution: Fixed Votes: 181
Labels: None
Environment:

Windows 64bit, up to date Java.


Attachments: PNG File MC-1040_1.png     PNG File MC-1040_2.png    
Issue Links:
Duplicate
is duplicated by MC-5361 Broken tools reappear after a while a... Resolved
is duplicated by MC-8384 Limited tool duplication Resolved
is duplicated by MC-10573 Reappearing of previously broken item... Resolved
is duplicated by MC-10641 crafting table disappears and I get m... Resolved
is duplicated by MC-16046 Right click with a Pickaxe Resolved
is duplicated by MC-16781 sheers break twice before breaking Resolved
is duplicated by MC-16916 Broken iron pickaxe enchanted with Un... Resolved
is duplicated by MC-18804 Tool Breaking Glitch Resolved
is duplicated by MC-26700 When an enchanted tool is used up, it... Resolved
is duplicated by MC-35278 problem with pickaxe with unbreaking ... Resolved
is duplicated by MC-36375 After breaking, if mouse held then to... Resolved
is duplicated by MC-40329 Broken items reappears in inventory w... Resolved
is duplicated by MC-44839 Items occasionally auto-magically rep... Resolved
is duplicated by MC-48145 After using a tool all the way down, ... Resolved
is duplicated by MC-48714 Enchanted Item Glitch on Shift-Click Resolved
is duplicated by MC-50188 Unbreaking Weapons and Tools Resolved
is duplicated by MC-54523 Tools don't "Break" Resolved
is duplicated by MC-60616 Broken tool regenerates back into hot... Resolved
is duplicated by MC-69506 recently broken tools come back with ... Resolved
is duplicated by MC-93144 Resurrecting a pickaxe that has just ... Resolved
is duplicated by MC-99880 Item Dupe bug Resolved
is duplicated by MC-102471 Axe not being destoryed when durabili... Resolved
is duplicated by MC-105148 Minecraft 1.10.2 broken tool duplication Resolved
is duplicated by MC-3652 items break and come back! Resolved
is duplicated by MC-4163 Broken axe coming back to inventory w... Resolved
Relates
relates to MC-3960 After the last use of a bow you get a... Resolved
CHK:
Confirmation Status: Confirmed
Game Mode: Survival

 Description   

What happened:
I was mining to the last of a diamond pick, it broke and I went to replace it with a new one. When I placed the new pick in the slot the old one reappeared and I was able to place it back in my bar. Sometimes I can use the pick, have it break, reappear and be reused several times before it breaks for good. As the pick breaks no breaking sound is heard.

What I expected to happen:
My pickaxe breaks... The end...

How to reproduce:
This seems very intermittent, there seems to be no link to anything. It's not every pick and I haven't noticed it on other items.

/give @p diamond_pickaxe 1 1561 {ench:[{id:34s,lvl:2s}]}

Code analysis: https://bugs.mojang.com/browse/MC-1040?focusedCommentId=288014&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-288014



 Comments   
Comment by Fabian Röling [ 27/Aug/16 ]

Or it could just not make a different calculation of whether to break the tool or not client-side, but immediately ask for the one of the server.
Also please don't comment that you experienced the same bug, that's redundant. Exceptions are:

  • Confirmation status is "Cannot reproduce" or "unconfirmed" or
  • the version you tested it in is not in the affected versions list (and active, meaning that it's the latest release or a relatively new snapshot)
Comment by CyanEmber [ 27/Aug/16 ]

I, too have experienced this bug. I was playing on a 1.10.2 server grinding cobblestone with an Unbreaking pick (I was using a book to hold down the mouse to mine) and whenever my pickaxe broke, I would wait a few seconds, and it would reappear with the durability I started mining with. I think this may have something to do with the fact that picks with Unbreaking do not get more durability. They still have the same amount of durability, but it doesn't decrease as often. This bug may be able to be fixed by adding more durability to a tool when it is enchanted with Unbreaking, or by adding a tag that only appears on tools with Unbreaking that tells the game how many more uses the tool has before it decreases its durability.

Comment by husky2490 [ 19/Jul/16 ]

I doubt it's permanent

Comment by E Strother [ 12/Jul/16 ]

If you have space in your bag, and don't pick up any items that would fill the slot when the item breaks, you can press Q to drop the tool even if it "breaks" and it will very often drop the tool. If immediately following the tool being broken you pick up an item that would fill the inventory space that that tool was in the tool will no longer exist.

Comment by Fabian Röling [ 25/Jun/16 ]

That's not the same bug, that's just server lag. Let me guess: The blocks you mined also appeared again.

Comment by husky2490 [ 25/Jun/16 ]

I've had this happen on a notoriously laggy server (not in 1.10 nor was the server vanilla) while strip mining with unenchanted stone picks. I would mine some blocks, they would disappear without dropping items and my pick would break. I wait a few seconds (as it was normal on that server) and some of the blocks would return and I got my tool back. It is also normal on that server to fall twice from the same point

Comment by null (Inactive) [ 23/Jun/16 ]

Confirmed for 1.10.2.

Comment by null (Inactive) [ 22/Jun/16 ]

Confirmed for 1.10.1.

Comment by null (Inactive) [ 08/Jun/16 ]

Confirmed for 1.10.

Comment by null (Inactive) [ 07/Jun/16 ]

Confirmed for 1.10-pre2.

Comment by null (Inactive) [ 03/Jun/16 ]

Confirmed for 1.10-pre1.

Comment by null (Inactive) [ 26/May/16 ]

Confirmed for 16w21b.

Comment by null (Inactive) [ 25/May/16 ]

Confirmed for 16w21a.

Comment by null (Inactive) [ 18/May/16 ]

Confirmed for 16w20a.

Comment by null (Inactive) [ 11/May/16 ]

Confirmed for 1.9.4.

Comment by null (Inactive) [ 05/May/16 ]

Confirmed for 1.9.3-pre3.

Comment by James (inactive) [ 15/Mar/16 ]

Confirmed for 1.9.1-pre3.

Comment by Marcono1234 [ 20/Feb/16 ]

Please add this example command to the description:

/give @p diamond_pickaxe 1 1561 {ench:[{id:34s,lvl:2s}]}
Comment by Marcono1234 [ 20/Feb/16 ]

Please link to this comment in the description of the report.

The following is based on decompiled version of Minecraft 1.8 using MCP. All method and class names are the names used in the decompiled version.

The reason why this happens it that the method public boolean attemptDamageItem(int amount, Random rand) of the net.minecraft.item.ItemStack class runs for the client and the server. This method tries to damage an item and returns true if the item broke. The problem is that Unbreaking is random, the higher the enchantment, the higher the chance that the item does not break. As it is random it is very likely that the client and the server get different results, for example the client thinks the item broke already whereas for the server the item is still there (this is described in this report).
This method should be only called from the server which needs to send then the according package and send that the client should display the breaking particles.

Comment by Immaterialise [ 17/Feb/16 ]

Confirmed for 1.9-pre1

Comment by Michael Mientus [ 03/Feb/16 ]

I am running 1.8.9 Vanilla. I was playing on single-player survival. I have a stone axe with Efficiency IV, Fortune III and Unbreaking III. I used it a few times and saw the durability bar appear. A short while later I noticed the durability bar had disappeared indicating the axe had full durability again. You probably would not notice small changes in durability while the bar is in the middle of its range. But it is obvious when a tool is resurrected or when the bar disappears. Based on these reports, the game seems to randomly update durability for Unbreaking tools. I don't think this is a special case just for destroyed tools. I know that there are background checks that randomly update blocks. What routine can destroy a tool? And are there any background routines that affect tools? In my experience, there is always a random delay before the durability is increased.

Comment by Pascal Roeleven [ 26/Jan/16 ]

Confirmed for 16w03a.

Comment by James (inactive) [ 13/Jan/16 ]

Confirmed for 16w02a.

Comment by James (inactive) [ 23/Dec/15 ]

Confirmed for 1.8.8 and 15w51b. Here's a video demonstrating it.

Comment by Wisely [ 24/Nov/15 ]

Confirmed for 15w47c!
Just happend yesterday to me on a diamond shovel.

Comment by Fenhl (Max Dominik Weber) [ 14/Aug/15 ]

Affects 15w33b, and perhaps the summary and/or description should be updated to include at least some mention of the Unbreaking enchantment?

Comment by Jesika H [ 03/Aug/15 ]

Confirmed in 1.8.7 with a player connected by LAN to my game, his enchanted picks break and then reappear when he tries to replace it in hotbar. (The "replacement" falls on the ground and the "broken" pick reappears in hotbar.) He can do this several times before it truly breaks.

Comment by Darren Hiles [ 08/Nov/14 ]

Also F3+H(PC) works way more effectively at preventing you from going through a pick/tool you don't want to lose rather than hoping on a random bug to occur.

Comment by williewillus [ 08/Nov/14 ]

No this isn't an "undocumented feature"
The bug is that the item is breaking visually when it's not supposed to.
The client should always reflect the server accurately so this is a bug.

Comment by Chris K [ 07/Nov/14 ]

I actually kind of like this "undocumented feature" as I can safely use my more enchanted tools without worry of actually killing them. It took a lot of experience and two anvils to make my diamond pickaxe get efficiency IV unbreaking III.

Comment by Matthew Connor [ 18/Sep/14 ]

This happened to me in Minecraft 1.8 in single player survival. I had an iron pickaxe with Efficiency IV and Unbreaking III. When it ran out on the last block I was mining, the pickaxe made the breaking sound and disappeared like normal. I opened my inventory and moved a diamond pickaxe into the slot the enchanted iron pickaxe used to be in. When I did, the enchanted iron pickaxe suddenly reappeared and was thrown to the ground. I exited my inventory and picked it up off the ground. I was able to use it a few more times before it made the breaking sound again, broke for good and disappeared permanently. See attachments. Image "MC-1040_1.png" shows the enchanted iron pickaxe suddenly being thrown to the ground after the actions described above. Image "MC-1040_2.png" shows it back in my hotbar after I picked it back up off the ground.

Comment by Shiyuan Zhou [ 21/Aug/14 ]

Confirm in 14w34d, pickaxe and axe re-appear after broken. Not sure if it has anything to do with the Unbreaking enchantment though.

Comment by Anthony Thyssen [ 23/Jul/14 ]

Perhaps a solution is to have unbreaking enchant not work for the last use or last few uses.

That is when a pick only has one use left, it always breaks, regardless of unbreaking enchant. That way randomness caused by server-client sync does not play a part.

As this may happen quickly perhaps the last 5 or 10 uses of a tool does not allow unbreaking, so as to ensure client-servers are in sync in a tools last moments of life.

Comment by William Palmer [ 05/Jul/14 ]

I think part of the same issue: placing a new, undamaged tool, in the same hotbar slot as a recently-broken tool, can sometimes cause the new tool to disappear

Comment by a [ 18/Jun/14 ]

I'll mention 1.7.9 just because it's not listed yet in the Versions Affected.

Comment by williewillus [ 06/Jun/14 ]

Simple solution is to only damage tools on the serverside. This unfortunately gives the aesthetic glitch of not having the tool break apart animation.

Comment by Whilyam [ 02/May/14 ]

This remains an issue in the newest snapshot.

Comment by Whilyam [ 19/Feb/14 ]

This is indeed because of Unbreaking. Tested multiple times. Only Unbreaking tools come back from the dead. It seems that tools that have one use left break before the game calculates if the use counts or is absorbed by the Unbreaking enchantment.

Comment by Itouch2 [ 14/Feb/14 ]

Still affects 14w07a

Comment by Darren Hiles [ 16/Jan/14 ]

It's been a while since I experienced this but from what I remember it was always with the Unbreaking enchantment on. To me that suggests a calculation of amount of durability left before calculation of unbreaking effect.

I.e. Pickaxe has 1 durability left.
I use that 1 durability and pick breaks
Unbreaking effect is then calculated, and says nope it didn't break.

Not saying thats a conclusive answer or anything lol

Comment by Galaxy_2Alex [ 16/Jan/14 ]

Darren Hills: It should only have a problem in Singleplayer with Pickaxes with Unbreaking on them. Do you also experince this issue without Unbreaking being on the Pickaxe?

Comment by Darren Hiles [ 16/Jan/14 ]

If it was just a server lag problem I would have thought it would not exist in Single Player as well?

Comment by NekoJonez [ 16/Jan/14 ]

Honestly, I think server lag might be involved. Maybe the game thinks you still have some uses left while the server says no? Or am I understanding MC's logic wrong?

Comment by Galaxy_2Alex [ 16/Jan/14 ]

So, to summarize it:
It can be caused by server lag and/or the Unbreaking enchantment.
I can confirm the part with the Unbreaking enchantment, not the one with the server lag though.

Comment by NekoJonez [ 16/Jan/14 ]

I'm playing on a 1.7.4 server, and this is still the case. Mostly when I have an unbreaking pickaxe. I click on the slot with another tool and it's back for 2-3 uses.

Comment by Emoluvjd2 [ 28/Oct/13 ]

This used to happen to me on servers way back in beta 1.2, but I did have it happen somewhat recently with enchanted tools.

Comment by Philo Wintercoat [ 12/Oct/13 ]

I should think it would be easiest to take away the job of determining when a tool is broken from the client. Only the server/internal server should track the tool's status. (Not really sure why the client does it anyway, after release 1.3)
(There are probably two bugs present here, my proposal should fix at least one of them.)

Comment by Galaxy_2Alex [ 28/Sep/13 ]

Not only servers, but what I'm experiencing is maybe another bug.
What I can confirm is that at the end of a life of a tool with Unbreaking on it, the pickaxe sometimes behaves very strange (especially with higher levels of Unbreaking).

Comment by Marcono1234 [ 28/Sep/13 ]

This is often in muliplayer when it lags:
You break a block, but the server doesn't answer but your client version already subtract one health point of your tool. When the lag is away the client and the server synchronise and you get the tool back

I suppose it is like this

Comment by MightyPork [ 12/Jul/13 ]

@Th3F4114n0n3 I've had this regularly happening with plain stone swords, so I conclude the enchantment is not the (only) cause.

Comment by _zombiehunter [ 06/Jul/13 ]

Just had this problem in SMP (1.6.2), would anyone be so kind and update the "affects versions" ?

Comment by Th3F4114n0n3 [ 19/Jun/13 ]

It has to do with the formula they use to determine how much the tools durability goes up due to the enchantment level.. it can result that when the tool breaks the enchanment deletes first by mistake and then you get a negative durability... because negative durability cant exist is change the negative number into a positive (i.e. -15 becomes 15) making it restore in your inventory.

Comment by Matt Basta [ 30/May/13 ]

This seems to happen with unbreaking tools when the tool would otherwise break (i.e.: it has a single unit of durability remaining), but the unbreaking subsequently re-adds the use to the tool. The client doesn't know that the server might un-break the tool, so it subtracts one durability, makes the tool break, then the server responds, "Oh no, it's fine don't worry about it, it's still got a use left."

Comment by Jasper Rebane [ 14/May/13 ]

If i use something to freecam in server and then break blocks, client will show that pickaxe is used!

Comment by Jeremy Dreyer [ 03/Feb/13 ]

I just had this happen to me on 13w05b on an Unbreaking I Iron Shovel, so it has yet to be fixed.

Comment by Sealbudsman [ 01/Feb/13 ]

What you say makes sense, Marios. It sounds like a case of client-server sync issues.

Comment by Marios [ 01/Feb/13 ]

If the durability drops to 0 don't use it again because it is unpredictable whether it is going to break, not just because of the bug but because of the unbreaking enchantment. As I mentioned before, because of the bug the durability meter is not reliable. In order to make it refresh and show the real value what I do is pick up the tool and place again in the inventory. The durability meter will then refresh and show the actual value. I'm sure this behavior is connected with the breaking and reappearance of the tool and both are connected with this bug on unbreaking enchantment.

Comment by Sealbudsman [ 01/Feb/13 ]

Will, I tried doing that, and I'm finding that 'actually breaking' is a hard thing to predict with an Unbreaking tool. On an unenchanted tool, you could accurately say that a durability of 0 means that the next use will break the tool. But an Unbreaking tool can remain at 0 for several uses. To directly answer your suggestion, the glitchy breaks as well as the real breaks all occur when durability is 0. Maybe though, I misunderstand what you might mean by 'actually breaking'?

Comment by Will [ 29/Jan/13 ]

To see if it is actually breaking, someone might want to press F3 + H to get the durability shown.

Comment by Sealbudsman [ 28/Jan/13 ]

This happened to me just now in 1.4.7 with an Unbreaking III pickaxe.

Comment by Tom Willshire [ 28/Jan/13 ]

This happens for me in singleplayer and multiplayer when using any tool that has an Unbreaking enchantment on it.

Comment by Marios [ 15/Jan/13 ]

I agree about the unbreaking enchantment but I'm playing SSP so I confirm it in SSP 1.4.7 too.

Comment by TheCoryKid [ 14/Jan/13 ]

I've only ever had this happen when using an unbreaking-enchanted pickaxe in multiplayer. So I assume (as others have said) that it's related to these two things.

Comment by Marios [ 14/Jan/13 ]

Affects 1.4.7 too. Also the durability meter changes without using the tool.

Comment by Kenneth Willcocks [ 06/Dec/12 ]

I host a server and play almost exclusively SMP as a result, and it seems like this is a bug related to the Unbreaking enchantment. From what I can tell, the client and server are having a disconnect somewhere, causing the client to say that the item "Broke" and remove it from your inventory temporarily, until the server corrects it and gives you the item back.

Comment by Darren Hiles [ 31/Oct/12 ]

Yeh I won't complain about getting full use out of it. If I try really hard I almost convince myself that I'm getting more than I should lol

The only reason I'm saying anything is just the annoyance of having to do a pile of clicking when the game should remember what's left durability wise. =)

Comment by Ty [ 30/Oct/12 ]

Its just lag or your digging really fast so it counts one block too many times ignore it its going to happen and at least your not losing uses you did not use.

Comment by Darren Hiles [ 29/Oct/12 ]

It's on single player I've noticed it but I don't play a great deal on smp so it may occur but I haven't seen it. I'm a fairly new player so I don't have much idea of what's old and new. It's more an annoyance by the old reporting system.

Comment by Kumasasa [ 28/Oct/12 ]

Old bug, occuring also on vanilla servers

Comment by Chalmes (Jon) [ 28/Oct/12 ]

Is this singleplayer or SMP?

I used to get this all the time when playing on a Bukkit server, but i've not seen it since playing on vanilla.

Generated at Sun Jan 12 11:53:06 UTC 2025 using Jira 9.12.2#9120002-sha1:301bf498dd45d800842af0b84230f1bb58606c13.