-
Bug
-
Resolution: Duplicate
-
None
-
1.21.1, 24w34a
-
None
-
Unconfirmed
-
(Unassigned)
Trying to set custom villager trades which is buying items using negated/removed components causes a console error, and sets the trade incorrectly. When it's in the buy slot, the component in question is ignored, and when in the buyB slot it seems to just remove the buyB entry entirely.
Reproduce:
Take a villager, give them any workstation so they have a profession, then run the following command from a command block to add a custom trade using removed components.
data modify entity @e[type=villager,sort=nearest,limit=1] Offers.Recipes append value {buy:{id:"minecraft:porkchop",components:{"!minecraft:food":{}}},buyB:{id:"minecraft:porkchop",components:{"!minecraft:food":{}}},sell:{id:"minecraft:porkchop",components:{"!minecraft:food":{}}}}
The buyB slot is not present when the villager GUI is opened, and when running the following command, they show that the "!minecraft:food" component has been removed in the buy slot, but not in the sell slot
data get entity @e[type=villager,sort=nearest,limit=1] Offers.Recipes[-1]
The following error is also logged to the console:
Tested in 1.21, 1.21.1, 24w34a
- duplicates
-
MC-274451 Villager trades' "buy" slot does not support removing components, unlike the "sell" slot
- Resolved