The bug
Having items in your main hand or offhand will consume, charge or use that item when opening the trading GUI with a villager.
How to reproduce
Summon a villager
/summon villager ~ ~1 ~ {NoAI:1,Offers:{Recipes:[{buy:{id:air,Count:0},sell:{id:air,Count:0}}]}}
Run
/effect give @s minecraft:hunger 5 255
(Only needed for food items)Pick an item from "Affected Items"
Right click the summoned villager
Wait (If the item is a food or potion)
→ ❌ You will consume, charge or use the item
Affected Items
Food and potions (Causes you to consume the item)
Fishing rod in main hand or offhand (Causes you to use the fishing rod)
Trident in offhand (Causes you to charge the trident)
Bow in offhand (Causes you to charge the bow)
See
[media]if you have trouble reproducing.
Linked issues
is duplicated by 24
relates to 2
Attachments
Comments 27
I can't reproduce, but did the item seemingly get consumed instantly? If so it's probably MC-849
Is this still happening in 1.16-pre2? I tested against 20w22a and replicated this, but I cannot repro it in the pres, so I think it may have been fixed incidentally.
Or does this only happen to farmers? Or is it because the farmer now wears a diamond...?