The Bug:
The durability of items enchanted with mending that are held in the offhand or worn in armor slots don't get updated when a GUI is open.
My tool with mending was in my off-hand and I was disenchanting some of the fishing rods (that I got from my afk fish farm) with the grindstone, the tool didn't get updated until I closed the gui of the grindstone, so I disenchanted fishing rods more than I need to repair my tool.
Steps to Reproduce:
Place down a grindstone and obtain a sword with some enchantments on it by using the command provided below.
/give @s minecraft:diamond_sword{Enchantments:[{id:"minecraft:sharpness",lvl:5}]}
Hold any tool with low durability that's enchanted with mending in your offhand, for example, a wooden shovel by using the command provided below.
/item replace entity @s weapon.offhand with minecraft:wooden_shovel{Damage:58,Enchantments:[{id:"minecraft:mending",lvl:1}]}
Switch into survival mode, open the grindstone, and disenchant the diamond sword.
Wait until you collect all of the experience orbs from disenchanting the sword.
Close the grindstone GUI and watch the shovel held in your offhand closely as you do this.
Take note as to whether or not the durability of items enchanted with mending held in the offhand only updates once the grindstone GUI is closed.
Observed Behavior:
The durability of items only updates once the GUI is closed.
Expected Behavior:
The durability of items would always update in the moment regardless of whether or not GUIs are open.
Linked issues
is duplicated by 6
Attachments
Comments 10
Can confirm this in 1.18 Pre-release 6. Here are some extra details regarding this problem.
The Bug:
The durability of items enchanted with mending held in the offhand only updates once the grindstone GUI is closed.
Steps to Reproduce:
Place down a grindstone and obtain a sword with some enchantments on it.
/give @s minecraft:diamond_sword{Enchantments:[{id:"minecraft:sharpness",lvl:5}]}
Hold any tool with low durability that's enchanted with mending in your offhand, for example, a wooden shovel.
/item replace entity @s weapon.offhand with minecraft:wooden_shovel{Damage:58,Enchantments:[{id:"minecraft:mending",lvl:1}]}
Switch into survival mode, open the grindstone, and disenchant the diamond sword.
Wait until you collect all of the experience orbs from disenchanting the sword.
Close the grindstone GUI and watch the shovel held in your offhand closely as you do this.
Take note as to whether or not the durability of items enchanted with mending held in the offhand only updates once the grindstone GUI is closed.
Observed Behavior:
The durability of items enchanted with mending held in the offhand only updates once the grindstone GUI is closed.
Expected Behavior:
The durability of items enchanted with mending held in the offhand would always update accordingly regardless of whether or not the grindstone GUI is open or closed.
This seems to always occur when any UI is open. I noticed this with villagers.