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.

Related issues

MC-149004 Accessing Villager trade screen with a click-to-use item in hand uses it MC-149196 right clicking a villager with food in hand makes you consume it in the menu MC-149711 While trading with farmers you eat food in your hand MC-150366 error when trading hungry MC-150556 Starting to eat when going into trading UI MC-152517 Opening villager trade UI will make most items used during/after the UI is open/close MC-152550 Right click on entity with food cause player eat the food and open gui MC-153144 Minor Villager Interaction Problem MC-157324 Golden Apple bug with villagers MC-158558 When entering a villager trading window with a consumable in hand, the player will consume the item. MC-159950 Сunning Farmer MC-164986 Right clicking on Villager with bow in hand loads the bow MC-167345 Eating a suspicious stew while opening a edited villager MC-167804 [FIXED] Eating food while talking to villager MC-170190 Player Eats when accessing Villager GUI MC-171545 Clicking Villagers with food causes you to eat the food. MC-173387 bow loading when on off hand when trading with villagers MC-175254 Player automaticially eats food in offhand when trading with villagers MC-175537 right clicking a villager with a villager spawn egg opens trading gui and spawns baby villager MC-181227 right clicking a villager with a job and holding food will eat the food and open the trading gui MC-183118 Trade food bug MC-184128 Villagers and second hand bow MC-187315 Holding a bow while in a villager's UI draws the bow back. MC-190188 Bug when clicking to a villager with food.

Attachments

Comments

migrated
[media]
migrated

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

tryashtar

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

migrated

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

wobst.michael

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

migrated

This is still an issue in 1.14 release.

I run Arch Linux, Oracle Java 8.

migrated

Issue reopened as there is extra information was added which came fromy bug report.

migrated

Happens in 1.14.2 - Pre-Release 3

migrated

This also affects the scoreboard minecraft.used:minecraft.carrot_on_a_stick. If you are holding one when right clicking a villager the number goes up.

migrated

Shields are also affected by this issue.

bdm68

Affects 1.14.2. (Pro tip ... do not have a Power V bow active in either hand when trading with villagers.)

migrated

It also happens in 1.14.4, I don't want to kill my villagers, this bug is very annoying

migrated

Crazy new info on this! If you right click a villager with a signed written book, it opens the book instead. After doing so, a few strange things happen! One is that you can't open the villagers trading at all. The other is that hot keying anything into the offhand slot turns invisible. Weirdest of all is that if you hot key something into the offhand slot then go into your inventory and place a different item into the offhand slot, that item you hot keyed will be completely deleted!

This effect goes away either by saving and quitting, waiting for a bit.

blablubbabc

Can confirm the weird behavior when interacting with a villager while holding a signed book in hand. MC 1.15.1. Does not affect villagers without profession / trades.

pine1needle

Alex Smith, your comment sounds like MC-166959, but your comment lists additional details. I’ve left a comment on that ticket linking to your comment.

migrated

Can confirm this bug still exists in 20w07a

migrated

Can confirm for 20w09a

YourCoal

I just recorded a little video demonstrating what happens.

https://www.youtube.com/watch?v=o-grR3yJcSo

 

I couldn't get it to replicate as perfect as I wanted, but basically it shows a freshly spawned entity (eventually) has the bug where opening its trading GUI will consume an item, such as food or equip armor. However, saving & exiting to the main menu and re-joining the world fixes it. This also happens on Multiplayer, however the difference is the server needs to be saved, stopped, and restarted and the same effect will occur.

While this video was recorded on 1.15.2, this problem still persists in 20w10a.

migrated

Can confirm for 20w13b

migrated

I made another bug report that is related to this one. MC-177872

migrated

@Your Coal
I tried to reproduce it in the steps you did in your video, and I found that if you click on a villager constantly until it gets a profession, then the item gets consumed when opening the GUI. However when doing so after the villager has gotten the profession, this issue does not persist. Very strange!

migrated

This is in effect in 20w18a

migrated

This is a major problem, especially when the held item is a well-enchanted bow 😞

The issue does not always occur for me, but is quite common

j_p_smith

Interestingly, this issue does not affect wandering traders.

coschevi

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.

TheGabro

Cannot reproduce in 1.16 pre-2

migrated

Unable to reproduce in 1.16-pre2 either.

migrated

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 😞 )

migrated

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