Minecraft command: villager trading adventure mode items

Can someone tell me why this command doesn't work?

/summon Villager ~ ~1 ~ {CustomName:Jerry,CustomNameVisible:0,NoAI:1,Offers:{Recipes:[{maxUses:10,buy:{id:lever,Count:1,Damage:#},buyB:{id:cooked_porkchop,Count:30,Damage:#},sell:{id:lever 1 0 {CanPlaceOn:["minecraft:diamond_ore"]},Count:1,Damage:#}}]}}

the villager isn't selling adventure mode item

2

1 Answer

Your id value for the sell compound is incorrect. It appears you may have copy/pasted a /give command into NBT data. The entire line "lever 1 0 {CanPlaceOn:["minecraft:diamond_ore"]}" is seen as the item's ID, which is invalid.

Any tags that are not the root id, Damage, Count, and Slot must be placed within a single tag compound.

Fixed command:

/summon Villager ~ ~1 ~ {CustomName:Jerry,CustomNameVisible:0,NoAI:1,Offers:{Recipes:[{maxUses:10,buy:{id:lever,Count:1,Damage:0},buyB:{id:cooked_porkchop,Count:30,Damage:0},sell:{id:lever,Count:1,Damage:0,tag:{CanPlaceOn:["minecraft:diamond_ore"]}}}]}}
0

You Might Also Like