TransWikia.com

Removing a specific trade from a villager (minecraft 1.16)

Arqade Asked on April 21, 2021

I’m trying to make it so that when a villager runs out of stock of a specific trade, it removes that trade from the villager.

I’m stuck at the part where I remove the trade.
So far I can only wipe the villager’s trades or add a new trade, but not remove a specific trade.

I’ve tried using

/data modify with the path : Offers.Recipes[{buy:{id:”minecraft:stone”},sell:{id:”minecraft stone”}}]

I’ve also tried it with the Count tag, but it does not work either.

One Answer

Instead of using /data modify, use /data remove.

/data remove @e[type=villager,name="TheVillagerToActUpon",limit=1] Offers.Recipes[{buy:{id:"minecraft:stone"},sell:{id:"minecraft:stone"},Uses:5}]

Replace the 5 in Uses:5 to say how many times the trade can be used. Put the command in a repeating command block.

Correct answer by ExpertCoder14 on April 21, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP