mojira.dev
MC-141494

Opening the trading GUI while holding items causes one to consume, charge or use it

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

  1. Summon a villager

    /summon villager ~ ~1 ~ {NoAI:1,Offers:{Recipes:[{buy:{id:air,Count:0},sell:{id:air,Count:0}}]}}
  2. Run /effect give @s minecraft:hunger 5 255 (Only needed for food items)

  3. Pick an item from "Affected Items"

  4. Right click the summoned villager

  5. 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

MC-149004 Accessing Villager trade screen with a click-to-use item in hand uses it Resolved MC-149196 right clicking a villager with food in hand makes you consume it in the menu Resolved MC-149711 While trading with farmers you eat food in your hand Resolved MC-150366 error when trading hungry Resolved MC-150556 Starting to eat when going into trading UI Resolved

Attachments

Comments 27

Henry Fleminger Thomson

Or does this only happen to farmers? Or is it because the farmer now wears a diamond...?

I can't reproduce, but did the item seemingly get consumed instantly? If so it's probably MC-849

Henry Fleminger Thomson

No, it could be cancelled and it had an animation, sounds et cetera.

Please check if that's still an issue in the latest 1.14 development snapshot.

This is still an issue in 1.14 release.

I run Arch Linux, Oracle Java 8.

17 more comments

Interestingly, this issue does not affect wandering traders.

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.

Cannot reproduce in 1.16 pre-2

Unable to reproduce in 1.16-pre2 either.

Realy mad bug.
I could reproduce thus problem with a bow in version 1.15.2.

The bow was charging while i was trading, and after closing the trade, the bow fired and killed my villager (with mending, feather falling III and infinity trades 😞 )

Henry Fleminger Thomson

coschevi

Confirmed

Important

Entities, Player, UI

mojang_internal_1

Minecraft 1.13.2, Minecraft 18w50a, Minecraft 1.14, Minecraft 1.14.1, Minecraft 1.14.2 Pre-Release 3, ..., 20w18a, 20w19a, 20w20b, 20w21a, 20w22a

1.16 Pre-release 2

Retrieved