mojira.dev
MC-153160

Villagers don't auto-fill items if NBT data doesn't match

The bug

When trading an item that has different nbt tags than the one the villager requests, it does not auto fill when clicking the trade. If you put the item in however, it does allow you to trade it.

How to reproduce

  1. Summon a villager that buys stone:

    /summon villager ~ ~ ~ {VillagerData:{profession:farmer,level:6},Offers:{Recipes:[{buy:{id:stone,Count:1},sell:{id:emerald,Count:1}}]}}
  2. Ensure you have no stone in your inventory:

    /clear @s stone
  3. Give yourself a block of stone with an NBT tag:

    /give @s stone{tag:0}
  4. Open the villager's trading GUI and click on the stone trade
    → ❌ The stone is not inserted into the trading input slot

  5. Manually place the stone in the trading input slot
    → ✔ You are able to complete the trade

Linked issues

Attachments

Comments

j_p_smith

Confirmed in 1.15.2 and 1.16 Release Candidate 1. Steps to reproduce:

  1. Summon a villager that buys stone:

    /summon villager ~ ~ ~ {VillagerData:{profession:farmer,level:6},Offers:{Recipes:[{buy:{id:stone,Count:1},sell:{id:emerald,Count:1}}]}}
  2. Ensure you have no stone in your inventory

  3. Give yourself a block of stone with an NBT tag:

    /give @s stone{BlockStateTag:0}
  4. Open the villager's trading GUI and click on the stone trade
    → ❌ The stone is not inserted into the trading input slot

  5. Manually place the stone in the trading input slot
    → ✔ You are able to complete the trade

pulpetti

In 1.16.1 and 20w29a

Mask3D_WOLF

Confirmed for 20w51a (as seen in MC-210040)

ampolive

Can confirm in 1.17.1.

migrated

Can confirm this affects regular crafting tables as well when accepting NBT tags

j_p_smith

Not fixed in 24w03a:

[media]

migrated

(Unassigned)

Confirmed

Village system

nbt, trading, villager

Minecraft 1.14.2, 1.15.2, 1.16 Release Candidate 1, 1.16, 1.16.1, ..., 20w51a, 1.16.5, 1.17, 1.17.1, 24w03a

24w03a

Retrieved