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

Villagers sometimes sell an incorrect book when shift-clicking a book trade

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.14.4, 1.15.1, 1.19.2, 24w46a, 1.21.4
    • None
    • Confirmed
    • Survival
    • Trading

      The bug

      When shift-clicking a trade, it sometimes buys a subsequent trade if there is enough remaining materials to buy the 2nd trade but not the first trade. This only occurs when the item ID is the same. In survival mode, this affects librarians with two enchanted book trades where shift-clicking the first trade can lead to the player receiving both the first and second book if its available for buying.

      Steps to reproduce

      • Summon the following villager:
        /summon villager ~ ~1 ~ {VillagerData:{profession:farmer,level:2,type:plains},PersistenceRequired:1,Offers:{Recipes:[{buy:{id:emerald,count:63},buyB:{id:book,count:1},sell:{id:golden_apple,count:1,components:{custom_name:'{"text":"1"}'}},rewardExp:0b,maxUses:9999999},{buy:{id:emerald,count:1},buyB:{id:book,count:1},sell:{id:golden_apple,count:1,components:{custom_name:'{"text":"2"}'}},rewardExp:0b,maxUses:9999999}]}}
      • Shift click the first trade with a stack of emeralds + 2 books
      • Observe that you receive two different items, each from the two available trades

            Unassigned Unassigned
            sof sofia
            Votes:
            6 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              CHK: