Minecraft – Custom Villager Summon Command

minecraft-commandsminecraft-java-edition

I am trying to summon a Villager that buys 64 Planks of any kind and giving you 1 gold nugget I have tried using

/summon Villager ~1 ~ ~ {Invulnerable:1,CustomName:Wood_Buyer,Profession:0,Career:1,Offers:{Recipes:[{buy:{id:planks,Count:64},sell:{id:gold_nugget,Count:1}}]}}

Which allows the player to swap 64 Oak Planks for 1 Gold Nugget. How would I add another trade for Birch, Spruce, etc. wood?

Best Answer

Use the Damage: value. For example, this villager will buy oak, birch, spruce and jungle wood:

/summon Villager ~1 ~ ~ {Invulnerable:1,CustomName:Wood_Buyer,Profession:0,Career:1,Offers:{Recipes:[{buy:{id:planks,Count:64},sell:{id:gold_nugget,Count:1}},{buy:{id:planks,Count:64,Damage:1},sell:{id:gold_nugget,Count:1}},{buy:{id:planks,Count:64,Damage:2},sell:{id:gold_nugget,Count:1}},{buy:{id:planks,Count:64,Damage:3},sell:{id:gold_nugget,Count:1}}]}}