Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-167040

Villager shows item in hands that it can't actually sell because of NBT

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.14.4, 1.15.2 Pre-release 2, 20w51a, 1.19
    • None
    • Confirmed
    • (Unassigned)

      The bug

      Villagers showing the item they want to trade ignore the NBT data, even though it is checked when trading.
      This means a villager can indicate that it wants to trade by holding an item even though the trade is not possible.

      Just to be clear, I don't want/expect that non-matching custom tags can still be traded with, I just want the villager not to show the item being sold in it's hands if an item with non-matching tags is held.

      How to reproduce

      1. /summon villager ~ ~ ~ {VillagerData:{profession:"minecraft:nitwit"},Offers:{Recipes:[{maxUses:100,buyB:{id:stone,Count:1b},buy:{id:stone,Count:1b},sell:{id:stone,Count:1b}}]}}
        
      2. /give @s stone{display:{Name:"[\"Test\"]"}}
        
      3. Hold the stone item in your hand
        The villager shows a stone item indicating that they want to trade
      4. Try to trade
        It does not work (as expected) because the NBT of the items does not match

            Unassigned Unassigned
            Bertie2011 Bertie
            Votes:
            3 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              CHK: