I was trying to trade with my villager but it didn't work, I have all the items needed but it just doesn't show up so I gave a villager a job and it was working with it
Linked issues
is duplicated by 19
relates to 1
Attachments
Comments 19
The Video:
Here's the nbt
Β 1.20.4 Villager has the following entity data: {Brain: {memories: {"minecraft:last_worked_at_poi": {value: 26332L}, "minecraft:job_site": {value: {pos: [I; -58, 72, 31], dimension: "minecraft:overworld"}}}}, HurtByTimestamp: 0, Attributes: [{Base: 48.0d, Modifiers: [{Amount: -0.013233750057890462d, Operation: 1, UUID: [I; -1134045425, -507688179, -1912325114, -1462673189], Name: "Random spawn bonus"}], Name: "minecraft:generic.follow_range"}, {Base: 0.5d, Name: "minecraft:generic.movement_speed"}], FoodLevel: 0b, Invulnerable: 0b, FallFlying: 0b, ForcedAge: 0, Gossips: [{Target: [I; -1666807936, -830519434, -1508254147, 1611017848], Type: "trading", Value: 8}], PortalCooldown: 0, AbsorptionAmount: 0.0f, LastRestock: 26030L, FallDistance: 0.0f, DeathTime: 0s, Xp: 376, LastGossipDecay: 4069L, HandDropChances: [0.085f, 0.085f], PersistenceRequired: 1b, UUID: [I; -1155492370, -1499971357, -1404270544, -39725950], Age: 0, Motion: [0.0d, -0.0784000015258789d, 0.0d], Health: 20.0f, LeftHanded: 0b, Air: 300s, OnGround: 1b, Offers: {Recipes: [{maxUses: 16, buyB: {count: 1, id: "minecraft:air"}, sell: {count: 1, id: "minecraft:emerald"}, buy: {count: 15, id: "minecraft:beetroot"}, xp: 2, priceMultiplier: 0.05f, demand: -32}, {maxUses: 16, buyB: {count: 1, id: "minecraft:air"}, sell: {count: 6, id: "minecraft:bread"}, buy: {count: 1, id: "minecraft:emerald"}, priceMultiplier: 0.05f}, {maxUses: 12, buyB: {count: 1, id: "minecraft:air"}, sell: {count: 1, id: "minecraft:emerald"}, buy: {count: 6, id: "minecraft:pumpkin"}, xp: 10, priceMultiplier: 0.05f, demand: -24}, {maxUses: 12, buyB: {count: 1, id: "minecraft:air"}, sell: {count: 4, id: "minecraft:pumpkin_pie"}, buy: {count: 1, id: "minecraft:emerald"}, xp: 5, priceMultiplier: 0.05f}, {maxUses: 12, buyB: {count: 1, id: "minecraft:air"}, sell: {count: 1, id: "minecraft:emerald"}, buy: {count: 4, id: "minecraft:melon"}, xp: 20, priceMultiplier: 0.05f, demand: -24}, {maxUses: 12, buyB: {count: 1, id: "minecraft:air"}, sell: {count: 18, id: "minecraft:cookie"}, buy: {count: 3, id: "minecraft:emerald"}, xp: 10, priceMultiplier: 0.05f}, {maxUses: 12, buyB: {count: 1, id: "minecraft:air"}, sell: {components: {"minecraft:suspicious_stew_effects": [{duration: 140, id: "minecraft:weakness"}]}, count: 1, id: "minecraft:suspicious_stew"}, buy: {count: 1, id: "minecraft:emerald"}, xp: 15, priceMultiplier: 0.05f, demand: 12}, {maxUses: 12, buyB: {count: 1, id: "minecraft:air"}, sell: {components: {"minecraft:suspicious_stew_effects": [{duration: 100, id: "minecraft:night_vision"}]}, count: 1, id: "minecraft:suspicious_stew"}, buy: {count: 1, id: "minecraft:emerald"}, xp: 15, priceMultiplier: 0.05f, demand: -12}, {maxUses: 12, buyB: {count: 1, id: "minecraft:air"}, sell: {count: 3, id: "minecraft:golden_carrot"}, buy: {count: 3, id: "minecraft:emerald"}, xp: 30, priceMultiplier: 0.05f, demand: -12}, {maxUses: 12, buyB: {count: 1, id: "minecraft:air"}, sell: {count: 3, id: "minecraft:glistering_melon_slice"}, buy: {count: 4, id: "minecraft:emerald"}, xp: 30, priceMultiplier: 0.05f, demand: -12}]}, Rotation: [304.91663f, -33.577244f], HandItems: [{}, {}], RestocksToday: 0, ArmorDropChances: [0.085f, 0.085f, 0.085f, 0.085f], CustomName: '"1.20.4 Villager"', Pos: [-56.38214247321418d, 72.0d, 31.480934292015206d], Fire: -1s, ArmorItems: [{}, {}, {}, {}], CanPickUpLoot: 1b, VillagerData: {profession: "minecraft:farmer", level: 5, type: "minecraft:plains"}, HurtTime: 0s, Inventory: []}
I can confirm this for 24w13a.
Offers:
{Recipes:
[{maxUses: 12,
buyB: {count: 1, id: "minecraft:air"},
sell: {count: 2, id: "minecraft:redstone"},
buy: {count: 1, id: "minecraft:emerald"},
priceMultiplier: 0.05f, demand: 2},
Β
So in order to fix the problem you either need to:
a) Delete the world.Β Only anything 1.20.4 and below is effected.
b) Wait for Mojang to fix it
c) Code a mod to fix it yourself on every villager you come across.
d) Remove the "BuyB" tag manually, or any other invalid "Offers" NBT data on the villager.
Have fun.
Had this issue happen last night on 1.20.2 setting up a new trading hall.
Moving villagers from villager breeder, to zombification station, to trading hall.Β Have some existing Librarians and a Fletcher which were converted and moved in, working fine.
Proceeded to move a few new villagers, converted and assigned to Librarians and Farmers, a single Armorsmith and single Toolsmith. The Farmers, Armorsmith, Toolsmith and Fletcher were all upgraded to Master rank.
Proceed with the same setup for next villager, setup as a Weaponsmith, got to Apprentice rank and accidentally flipped a trap door and they got out. Broke grindstone workstation and proceeded to catch in mine cart to bring back to cell.Β When I place the workstation again, the dual item trade bug appeared and I could no longer trade with the Weaponsmith.
I checked every other existing villager (again some already at Master rank) and they all displayed the same window with two spots. Tried placing emeralds in both slots and still can no longer trade with any villagers who have previously been traded with.Β
Not sure if the issue was breaking the workstation while it was upgrading from Apprentice to Journeyman, or something else, but was hoping some extra details may help resolve this issue.
I am able to replicate the issue in a creative world following the same steps. Set villager in cell, give workstation, trade, break workstation, can no longer trade due to dual trade spots displaying even for emerald only trades.
Confirmed 24w14a is still effected.
Will attach entire F3+I tags of the same bugged villager's NBT post 1.20.4 ->> 24w14a World Upgrade.
Β
Looks good using the "EmptyItemInVillagerTradeFix" and it works ideally moving forward;
But I also wanted to mention that the "matchesBuyItems() under "TradeOffer" was the main culprit, where the
"!this.secondBuyItem.isPresent()" logic should have been inverted and tested for this.secondBuyItem.get().match(ItemStack.EMPTY) as well, because reading in the
"Optional<TradedItem>this.secondBuyItem" does not check for minecraft:air, it only checks for the presence of data, which lead to this bug since 1.20.4 and below writes minecraft:air to any "Empty" trade slots.
π
We do not have enough information to find the cause of this issue.
Please record a video of this happening and attach it to this report.
If you are on Windows, you can use
Windows
+Alt
+R
to open a built-in app for recording game footage.If you are on Mac (Mojave or later), you can use
Shift
+Command
+5
to open a built-in app for recording your screen.In case you don't have a program to record videos, we recommend using the free recording software OBS.
In case the resulting video file is too large to be uploaded to the bug tracker directly, please upload it elsewhere (e.g. as unlisted video on YouTube) and link to it here.
This issue is being temporarily resolved as Awaiting Response. Once the requested information has been delivered, the report will be reopened automatically.
Quick Links:
π Bug Tracker Guidelines β π¬ Community Support β π§ Mojang Support (Technical Issues) β π§ Microsoft Support (Account Issues)
π Project Summary β βοΈ Feedback and Suggestions β π Game Wiki