Add a Trade to a Villager Using /data (1.14)

I am trying to add another custom trade to a pre-existing wandering trader without clearing all of its previous trades.

I have tried running this command:

/data modify entity @e[type=wandering_trader,limit=1] Offers.Recipies[] append value {maxUses:99999,buyB:{id:"minecraft:air",count:0b},buy:{id:"minecraft:stone",Count:1b},sell:{id:"minecraft:acacia_log",Count:1b}}

However, this does not work.

Does anyone know the proper syntax to do this, and if this is even possible?


The first mistake was obvious. You can't put a pair of square brackets in the path (Offers.Recipes[]).

The second mistake was not so obvious so it took me a few minutes to finally realize what it was. You misspelt "Recipes" and wrote "Recipies" instead. Also, you don't need to specify that buyB is air.

Correct command:

/data modify entity @e[type=wandering_trader,limit=1,sort=nearest] Offers.Recipes append value {maxUses:99999,buy:{id:"minecraft:stone",Count:1b},sell:{id:"minecraft:acacia_log",Count:1b}}