Minecraft Blogs / Tutorial

Making a Custom Villager Shop! [100% Vanilla]

  • 45,039 views, 0 today
  • 40
  • 23
  • 39
Cyentw's Avatar Cyentw
Level 54 : Grandmaster Programmer
126
There are so many new possibilities in the new update. One of them is creating your very own villager shop which buys and sells custom items!

Key: Red Codemeans that the command will not do anything if used. Blue Code means that the code is customize-able (ie a item ID). Orange Codeis the explanation for the code and should not be included if you wish to copy paste.

Step 1: Summon the Villager

/summon Villager ~~~

The ~~~ means that the villager will spawn from where the command is executed. For one space above where the command is executed, use ~~1~.

Step 2: Data Tags
Data tags are new to 1.7.1 and make this tutorial possible.

/summon Villager ~~~ {Offers:{Recipes:[{maxUses:1

Offers and Recipes just tell minecraft that we are going to make a shop, while maxUses tells us how many times thisparticularshop can be used.

Step 3: Buying and Selling Items

/summon Villager ~~~{Offers:{Recipes:[{maxUses:1,buy:{id:266,Count:16},sell:{id:276,Count:1}}]}}

This time we added buy:{and sell:{, which explain what the villager is offering. id:266means that the villager is buying gold ingots(id 266), and Count:16means that he is buying 16 at a time. The same goes for the sell; he is selling 1 diamond sword.

Step 4: Customizing the Items

/summon Villager ~ ~1 ~ {Offers:{Recipes:[{maxUses:1,buy:{id:266,Count:16},sell:{id:276,Count:1,tag:{ench:[{id:16,lvl:4}],display:{Name:Cyen's Scythe}}}}]}}

Here I added many things. First of all, I made the sword which the villager is selling enchanted. I typed ench:[{id, the enchantment id I wanted, and then ,lvl:4}], the level of enchantment I wanted.

Also, I gave the item a name, via {Name:, the name I wanted, and then }.

Final Result:
yEZMiKZpng

Want to learn more about data tags? Here's a list of all of them:http://minecraft.gamepedia.com/Chunk_format

Thanks for getting this blog on the popular reel!
Aepxcyypng

Want me to explain another type of data tag? (ie an invincible pig riding a skeleton or spawning in arrows with command blocks) Tell me in the comments section!

If you found this blog helpful, diamond!
If not, diamond anyways!

Thanks!
Tags

1 Update Logs

Update #1 : by Cyentw 10/28/2013 12:12:23 amOct 28th, 2013

Some formatting/spelling fixes.

Thanks for putting this blog on the reel!

Create an account or sign in to comment.

Wombatlord
04/10/2017 9:22 pm
Level 13 : Journeyman Engineer
Wombatlord's Avatar
How do you make it so i can add

"/give @p minecraft:lever 1 0 {CanPlaceOn:["minecraft:iron_block"],display:{Name:"Screwdriver"}}"
To the buy item?!
1
MallisTheGreat
01/29/2016 10:55 am
Level 1 : New Miner
MallisTheGreat's Avatar
Need some help with this code: /summon Villager ~1 ~ ~ {Invulnerable:1,CustomName:MallisTheGreat,Profession:2,Career:1,CareerLevel:4,Offers:{Recipes:[{buy:{id:280,Count:1},sell:{id:280,tag:{ench:{id:0,lvl:10000},{id:1,lvl:10000},{id:2,lvl:10000},{id:3,lvl:10000},{id:4,lvl:10000},{id:5,lvl:10000},{id:6,lvl:10000},{id:7,lvl:10000},{id:8,lvl:10000},{id:34,lvl:10000},{id:16,lvl:10000},{id:17,lvl:10000},{id:18,lvl:10000},{id:19,lvl:10000},{id:20,lvl:10000},{id:21,lvl:10000},{id:32,lvl:10000},{id:33,lvl:10000},{id:35,lvl:10000},{id:48,lvl:10000},{id:49,lvl:10000},{id:50,lvl:10000},{id:51,lvl:10000},{id:61,lvl:10000},{id:62,lvl:10000}],display:{Name:MallisTheGreat's Justice Bringer,Lore:"Brings justice even when you don't want to","Too powerful for the crowd",Count:1}}}]}
Is there any1 that can help me? It shows up "Unbalanced squared brackets" (Don't judge the enchants xD)
1
scheeric546
01/01/2019 7:15 pm
Level 1 : New Miner
scheeric546's Avatar
just after your ench: there is no starting square bracket
1
TheRedstoneWalrus
10/07/2015 6:58 am
Level 1 : New Miner
TheRedstoneWalrus's Avatar
Am i doing something wrong?
/summon Villager ~ ~2 ~{Offers:{Recipes:[{maxUses:/size]9999,buy:{id:263,Count:5,sell:{id:270,Count:1,tag:{ench:[32,lvl:1[size=14pt]}],display:{Name:Bitcoinminer 1.1}}}}]}}
1
TheRedstoneWalrus
10/07/2015 7:06 am
Level 1 : New Miner
TheRedstoneWalrus's Avatar
It says that its not a valid number
1
Gamerpr0
03/15/2015 8:45 pm
Level 1 : New Crafter
Gamerpr0's Avatar
Got an issue, what if I want to sell items like Tinkers construct Heart Canisters(red, yellow and green)?
1
DapperRaptor
01/03/2016 9:33 am
Level 1 : New Crafter
DapperRaptor's Avatar
well then you would just find the item ids for the heart canisters. simple really
1
StarhunterSolar
10/20/2014 6:01 pm
Level 10 : Journeyman Mage
StarhunterSolar's Avatar
It keeps Saying For Me" '~~1~' Is Not A Valid Number". What Is That About? I Can't Do Any Commands In My World!
1
Webdings
07/15/2016 1:58 am
Level 1 : New Explorer
Webdings's Avatar
A little late to the party but I believe it should be ~ 1 ~
1
Gartonia
01/12/2015 11:43 pm
Level 17 : Journeyman Scribe
Gartonia's Avatar
You don't have any spaces. It should be
~ ~1 ~
1
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome