1

Need Help With Custom Villager Trades

RubyProjects's Avatar RubyProjects3/22/20 11:08 am
1 emeralds 138 2
3/24/2020 5:30 pm
ShelLuser's Avatar ShelLuser
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}]}}
Posted by RubyProjects's Avatar
RubyProjects
Level 7 : Apprentice Network
3

Create an account or sign in to comment.

2

ShelLuser
03/24/2020 5:30 pm
Level 57 : Grandmaster Engineer
ShelLuser's Avatar
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:{}.
1
MrEmerald2006
03/22/2020 1:49 pm
Level 50 : Grandmaster Nerd
MrEmerald2006's Avatar
1
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome