Minecraft Villager swaps own items (Command)?

en
- in Mods
4

I know that there's a command with which you can spawn Villager, but I have the Techguns Mod and I want to know if it is possible for the Villager to exchange mod items. If so, please include a command or link in the answer.

gl

Give it a try

/ summon villager ~ ~ ~ {Offers: {Recipes: [{buy: {id: "minecraft: emerald", Count: 1b}}, {sell: {id: "ITEMNAME", Count: 1b}}]}}

(Replace ITEMNAME with the item in the mod)

Po

The villager must have a profession in order to be able to trade with him IIRC.

en

Well, I tried "techguns: pistol" with "Itemname", only "pistol" and the like. It didn't work to enter it… Incidentally, I had 1.12.2, which is why the "" were not necessary. Nevertheless, thank you for your efforts.

The command in 1.12.2 was:

/ summon villager ~ ~ ~ {Offers: {Recipes: [{buy: {id: stone, Count: 1b}}, {sell: {id: pistol, Count: 1b}}]}}

gl

OK

With pleasure