1
Need Help With Custom Villager Trades
Im making a pve map and I want to make a villager that can sell levers that can only be placed on oak logs. but I cant figure out where to put the {CanPlaceOn:} tag, help!
The command im using
/summon villager 3 5 -7 {VillagerData:{profession:toolsmith,level:99,type:plains},Invulnerable:1,PersistenceRequired:1,Silent:1,NoAI:1,Rotation:[45.3f,20.9f],CustomName:"\"Key Merchant - Forest\"",ActiveEffects:[{Id:23,Amplifier:0,Duration:999999}],Offers:{Recipes:[{buy:{id:rotten_flesh,Count:15},buyB:{id:spider_eye,Count:1},sell:{id:lever,Count:1,tag:{display:{Name:"\"Key - Forest\""}}},maxUses:9999999}]}}
The command im using
/summon villager 3 5 -7 {VillagerData:{profession:toolsmith,level:99,type:plains},Invulnerable:1,PersistenceRequired:1,Silent:1,NoAI:1,Rotation:[45.3f,20.9f],CustomName:"\"Key Merchant - Forest\"",ActiveEffects:[{Id:23,Amplifier:0,Duration:999999}],Offers:{Recipes:[{buy:{id:rotten_flesh,Count:15},buyB:{id:spider_eye,Count:1},sell:{id:lever,Count:1,tag:{display:{Name:"\"Key - Forest\""}}},maxUses:9999999}]}}
Create an account or sign in to comment.
2
Since CanPlaceOn would refer to the lever you'd put that into the section which contains the lever definition.
When in doubt it's usually best to look up an item on the official wiki and then check the data values. Here's the URL for the level: https://minecraft.gamepedia.com/Lever
To get the datavalues for the block you'll need to check another page: https://minecraft.gamepedia.com/Java_Edition_data_values
Alas, in this case it's a property which only applies to adventure mode, so the property can be used anywhere within the level data values (the NBT). Could place it before tag:{}.
When in doubt it's usually best to look up an item on the official wiki and then check the data values. Here's the URL for the level: https://minecraft.gamepedia.com/Lever
To get the datavalues for the block you'll need to check another page: https://minecraft.gamepedia.com/Java_Edition_data_values
Alas, in this case it's a property which only applies to adventure mode, so the property can be used anywhere within the level data values (the NBT). Could place it before tag:{}.