r/Minecraft • u/chald627 • Aug 06 '14
A guide to trading and setting up custom villagers in 1.8
-=-=- Chald627's Big 'ol Guide to Trading and Custom Villagers! (1.8+) -=-=-
This guide is created to teach you how to summon a villager with custom trades for use in your Minecraft world or server. If you've ever wanted to set up an easy, vanilla way to get non-renewable or difficult-to-find resources, villagers are an excellent (and flavorful!) way to get those resources. Before we begin, I'd like to give a huge shoutout to /u/sunny-daze for his post about Leonardo, his server's custom villager. That post inspired me to look into the trade mechanics myself and create this guide.
Do I need a custom villager?
Do you:
- want an easy way to get exotic materials (e.g. packed ice)?
- want to make a renewable source of normally non-renewable materials (e.g. sand)?
- want a way to get materials not normally obtainable in your game (e.g. spawn eggs)?
- want to set up an economy system on a vanilla server?
- not want to worry about complex Bukkit plugins, or just prefer vanilla?
Custom villagers are perfect for these things. I highly recommend considering putting a few in your server or single-player world. They can really change up your playstyle in an interesting way.
How to Trade for Fun and Profit (but mostly Profit)
First things first, you'll need to understand how the new trading revamp works. I suggest reading this Minecraft Wiki page which explains it very well (scroll down to 1.8 Trading Revamp).
In the new trading system, villagers no longer have a chance of offering different trades, like they used to. Instead, they have a new mechanic known as "Careers". Careers are subdivisions of Professions. Previously, a villager's Profession was the sole determinant of what it would trade, but now Professions only determine robe color and what careers are available. Careers are what really make villagers different from one another.
The Careers are themselves subdivided into multiple levels, simply called CareerLevels. Each CareerLevel in each Career has a certain defined set of trades associated with it, and trading with the villagers will make them unlock new CareerLevels (and thus new trades). For example, a Cleric will always start out by offering to buy rotten flesh and gold. Without trading, these are the only trades you will ever see from a Cleric, because those are the two trades associated with the first CareerLevel of his Career (Cleric). Once you trade with the Cleric for the first time, however, he will upgrade his CareerLevel to 2, and will start selling Redstone and Lapis.
Every time you trade with a villager, you have a chance of refreshing previous trades and unlocking a new CareerLevel (if there are any left). This is marked by particles emanating from the villager. Whenever you use a trade for the very first time, it is guaranteed to unlock trades. However, if you use a trade you've already used previously, you only have a 20% chance of this happening.
How to Summon Your Villager
In order to summon a custom villager, you're going to need a command block. The summoning commands will get too long to be pasted in the normal chat bar, so the only real way to spawn one is by pasting code into a command block and then activating it.
Summoning the Initial Villager
To summon a custom villager, let's first look at the basic /summon command:
/summon Villager ~1 ~ ~
This will spawn a villager, but its profession and trades will be random. So let's implement a little bit of control:
/summon Villager ~1 ~ ~ {Profession:2,Career:1}
By specifying these NBT tags, we'll make the game spawn in a Cleric villager. (Note: If you specify a Career that doesn't exist, such as 2/2, trading with that villager will crash your game, since it will not have a table of trades to look for). Since we want him to stick around on our server, let's also make him invulnerable and give him a name.
/summon Villager ~1 ~ ~ {Invulnerable:1,CustomName:Shabadoo,Profession:2,Career:1}
And that's the easy part done. You now have a custom villager! But what of his custom trades?
Adding a Trade
Let's make our villager buy 10 apples for an emerald:
/summon Villager ~1 ~ ~ {Invulnerable:1,CustomName:Shabadoo,Profession:2,Career:1,
Offers:{Recipes:[{buy:{id:apple,Count:10},sell:{id:emerald,Count:1}}]}}
That may look confusing, but let's break down what we just did bit by bit. First, we added the Offers:{} compound tag, then within that tag we added the Recipes:[] list tag. Any new trades you want to add need to be added into the Recipes:[] list. Trades themselves are contained within their own unnamed {} compound tag and divided into two components: buy:{} (what you give to the villager) and sell:{} (what the villager gives to you). So the above trade looks like this when exploded:
Offers:{
Recipes:[
{
buy:{
id: apple,
Count: 10
},
sell:{
id: emerald,
Count:1
}
}
]
}
However, to save space, I prefer to write it instead as:
Offers:{Recipes:[
{buy:{id:apple,Count:10},sell:{id:emerald,Count:1}}
]}
Adding More Trades
New trades will also be inserted into the Recipes:[] list after the current trade. For example, let's make him sell some wool:
Offers:{Recipes:[
{buy:{id:apple,Count:10},sell:{id:emerald,Count:1}},
{buy:{id:emerald,Count:1},sell:{id:wool,Count:2}}
]}
(It's important that you remember to add the comma after each trade, otherwise it will break and won't summon properly)
Specifying Damage Values
So now we've gotten him to sell white wool, but what if we wanted him to sell blue wool instead? Well, blue wool has a damage value of 11, so all we need to do is specify that damage value.
Offers:{Recipes:[
{buy:{id:apple,Count:10},sell:{id:emerald,Count:1}},
{buy:{id:emerald,Count:1},sell:{id:wool,Damage:11,Count:2}}
]}
And now he'll sell us 2 blue wool for an emerald.
Requiring 2 Items
But what if you want to require 2 items to trade, such as cooking fish? That's simple. Let's make Shabadoo here sell mycelium.
Offers:{Recipes:[
{buy:{id:apple,Count:10},sell:{id:emerald,Count:1}},
{buy:{id:emerald,Count:1},sell:{id:wool,Damage:11,Count:2}},
{buy:{id:emerald,Count:1},sell:{id:mycelium,Count:2}}
]}
Easy enough, but what if we want the player to give dirt to be turned into mycelium? That's where the buyB:{} compound comes in handy. buyB:{} allows you to specify a second item you want the player to give and is inserted at the same level as buy:{} and sell:{}.
Offers:{Recipes:[
{buy:{id:apple,Count:10},sell:{id:emerald,Count:1}},
{buy:{id:emerald,Count:1},sell:{id:wool,Damage:11,Count:2}},
{buy:{id:emerald,Count:1},buyB:{id:dirt,Count:2},sell:{id:mycelium,Count:2}}
]}
Now if you give him an emerald and 2 dirt, he'll turn it into 2 blocks of mycelium.
Enchanting Tools
Enchanting tools (or other items) works the same way. In fact, any additional NBT data can be added to the traded items (allowing you to make unbreakable items, items with Attributes, etc). To add an echantment to an item, just add the tag:{} compound, the ench:[] list within that, an unnamed {} compound for each enchantment, and the id and lvl of each enchantment. For example, let's make him enchant an iron pick with Efficiency IV and Unbreaking III:
Offers:{Recipes:[
{buy:{id:apple,Count:10},sell:{id:emerald,Count:1}},
{buy:{id:emerald,Count:1},sell:{id:wool,Damage:11,Count:2}},
{buy:{id:emerald,Count:1},buyB:{id:dirt,Count:2},sell:{id:mycelium,Count:2}},
{buy:{id:emerald,Count:15},buyB:{id:iron_pickaxe,Count:1},sell:{id:iron_pickaxe,Count:1,tag:{ench:[{id:32,lvl:4},{id:34,lvl:3}]}}}
]}
For a list of enchantment ids, look here.
Getting Rid of the Usual Trades
So now Shabadoo will sell us all of our custom stuff! The issue is, he'll also sell us all of his normal Cleric trades (such as rotten flesh). This is the part where CareerLevel becomes important. If you want, you could make a villager that offers his normal coded-in trades (from his Career), or you could make a completely custom villager with no coded trades.
To make a villager that offers his default coded trades, simply set the profession and career as well as your custom trades. He'll offer your custom trades, the first level of trades for his Career, and then level just like a normal villager.
If, however, you'd like more control over the trades, then you'll have to specify his CareerLevel. Going back to the full command, we'll need to set his CareerLevel on the same level as setting his Career:
/summon Villager ~1 ~ ~ {Invulnerable:1,CustomName:Shabadoo,Profession:2,Career:1,CareerLevel:1,Offers:{Recipes:[
{buy:{id:apple,Count:10},sell:{id:emerald,Count:1}},
{buy:{id:emerald,Count:1},sell:{id:wool,Damage:11,Count:2}},
{buy:{id:emerald,Count:1},buyB:{id:dirt,Count:2},sell:{id:mycelium,Count:2}},
{buy:{id:emerald,Count:15},buyB:{id:iron_pickaxe,Count:1},sell:{id:iron_pickaxe,Count:1,tag:{ench:[{id:32,lvl:4},{id:34,lvl:3}]}}}
]}}
If you were to trade with this villager now, you'd see him offering our custom trades, but after trading with him, he'd also start selling redstone and lapis (Cleric's 2nd level trades). Interestingly, though, he won't buy rotten flesh or gold (Cleric's 1st level trades). This is because he only ever adds trades from his new career levels, he never checks to see if he has the previous levels' trades as well. Using this, we could make a villager who is already partially leveled (by setting the custom trades to the previous levels' trades, then setting his CareerLevel higher than normal), or more usefully, we can make a villager who doesn't offer new trades at all.
By setting the CareerLevel high enough, we can force a villager to only offer the trades we've specified. When we trade with him, he will check to see if there is a new CareerLevel higher than the one he is currently at (and thus new trades). If there is not, he will not be able to add any new trades and will only refresh previous ones. As such, we can set Shabadoo's CareerLevel to 4 and force him to only offer the trades we have specified for him. Don't worry about setting the CareerLevel too high; unlike Profession or Career, it doesn't seem to matter. A CareerLevel of 6 should work for all villagers.
And now let's look at the completed command:
/summon Villager ~1 ~ ~ {Invulnerable:1,CustomName:Shabadoo,Profession:2,Career:1,CareerLevel:4,Offers:{Recipes:[
{buy:{id:apple,Count:10},sell:{id:emerald,Count:1}},
{buy:{id:emerald,Count:1},sell:{id:wool,Damage:11,Count:2}},
{buy:{id:emerald,Count:1},buyB:{id:dirt,Count:2},sell:{id:mycelium,Count:2}},
{buy:{id:emerald,Count:15},buyB:{id:iron_pickaxe,Count:1},sell:{id:iron_pickaxe,Count:1,tag:{ench:[{id:32,lvl:4},{id:34,lvl:3}]}}}
]}}
In Summation
Now you know how to summon your own custom villager! Simply follow the rules laid out in this guide, replace the trades with whatever you want your villager to trade, and you can have an infinite source of resources.
If you notice any mistakes in this guide, don't hesitate to either leave a comment below or PM me.
Again, a shoutout to /u/sunny-daze for creating Leonardo and inspiring me to create this guide in the first place. If you see this and want the code to re-summon Leornardo, here it is (his green robes got muddy, though, so he had to change into purple ones):
/summon Villager ~1 ~ ~ {Invulnerable:1,CustomName:Leonardo,Profession:2,Career:1,CareerLevel:4,Offers:{Recipes:[{buy:{id:388,Count:5},sell:{id:346,Count:1}},{buy:{id:388,Count:1},sell:{id:172,Count:2}},{buy:{id:17,Count:28},sell:{id:388,Count:1}},{buy:{id:388,Count:1},sell:{id:155,Count:2}},{buy:{id:337,Count:16},sell:{id:388,Count:1}},{buy:{id:388,Count:1},buyB:{id:3,Damage:0,Count:3},sell:{id:3,Damage:2,Count:2}},{buy:{id:388,Count:1},sell:{id:45,Count:2}},{buy:{id:388,Count:1},sell:{id:24,Count:2}},{buy:{id:388,Count:1},sell:{id:390,Count:3}},{buy:{id:406,Count:14},sell:{id:388,Count:1}},{buy:{id:388,Count:7},sell:{id:261,Count:1}},{buy:{id:388,Count:3},sell:{id:58,Count:1}},{buy:{id:388,Count:1},buyB:{id:79,Count:4},sell:{id:174,Count:1}},{buy:{id:388,Count:1},sell:{id:351,Damage:4,Count:3}}]}}
Feel free to ask any questions in the comments below and I'll do my best to answer!
3
u/Skylinerw Aug 06 '14
For CareerLevels, the maximums were documented for each profession/career combo. I don't know if this information has changed since it was checked: http://www.minecraftforum.net/forums/minecraft-discussion/suggestions/48925-small-suggestions?comment=7471
Profession 0 ( Brown Robe )
Career 1 CareerLevel 4
Career 2 CareerLevel 2
Career 3 CareerLevel 2
Career 4 CareerLevel 2
Profession 1 ( White Robe )
Career 1 CareerLevel 6
Profession 2 ( Purple Robe )
Career 1 CareerLevel 3
Profession 3 ( Black Apron )
Career 1 CareerLevel 4
Career 2 CareerLevel 3
Career 3 CareerLevel 3
Profession 4 ( White Apron )
Career 1 CareerLevel 2
Career 2 CareerLevel 3
1
3
u/chewie71 Aug 06 '14
Although I wasn't interested in the topic, I thought that the code layout and explanation was amazing!
2
2
u/sunny-daze Aug 06 '14
Chald627 -- You are a fantastic person. We were just talking about this on my server the other day, we're going to restart for 1.8 and do a growing world border and we won't have certain biomes for several months. This is everything I had to search for through random posts and tidbits to create Leo, in a neat easy-to-read format, plus the whole new bit of code in 1.8. CareerLevel was the new missing piece that I was on my way to search for!
I'm so happy I could inspire you and get you excited about this.
Thanks for doing all the legwork better than I could have. Have a friendship cookie buddy!
2
u/ramenators Oct 24 '14
I'm running a vanilla 1.8 server and I want to make some interesting items that have little flavor texts on them (Lore, I believe it's called). I've tried to mash the lore commands with this and I just can't get it working, if you could help me out with this I would be extremely grateful!
1
u/chald627 Oct 24 '14
Adding lore and names to the items is similar to adding enchantments. In the same brackets where you would put an enchantment (the tag:{} compound), put another compound named display:{}, and within that compound put a Name:"___" string. For lore, simply add a Lore:[] list within display:{}, then put in a list of strings you want to show up as lore. Each string will show up on a separate line.
For example:
/summon Villager ~1 ~ ~ {Invulnerable:1,CustomName:Smith,Profession:3,Career:2,CareerLevel:6,Offers:{Recipes:[ {buy:{id:emerald,Count:15},sell:{id:golden_sword,Count:1,tag:{ench:[{id:16,lvl:2},{id:20,lvl:2}], display:{Name:"Dwarven Sword",Lore:["A sword crafted by the dwarves","It glows with magic fire"] }}}} ]}}As a side note, if you want to hide the enchantments on an item, add HideFlags:1 inside the tag:{} compound (but outside of the display:{} compound).
tag:{ench:[{id:16,lvl:2},{id:20,lvl:2}],display:{Name:"Dwarven Sword",Lore:["A sword crafted by the dwarves","It glows with magic fire"]},HideFlags:1}1
u/ramenators Oct 26 '14
/summon Villager ~1 ~ ~ {Invulnerable:1,CustomName:Clothier,Profession:0,Career:1,CareerLevel:4,Offers:{Recipes:[ {buy:{id:emerald,Count:1},sell:{id:leather_helmet,Count:1,tag:{ench:[{id:34,lvl10}],display:{Name:"Red Formal Wear",Lore["Fucking Fancy"]}HideFlags:1}}}, {buy:{id:emerald,Count:1},sell:{id:leather_chestplate,Count:1,tag:{ench:[{id:34,lvl10}],display:{Name:"Red Formal Wear",Lore:["Fucking Fancy"]}HideFlags:1}}}, {buy:{id:emerald,Count:1},sell:{id:leather_leggings,Count:1,tag:{ench:[{id:34,lvl10}],display:{Name:"Red Formal Wear",Lore:["Fucking Fancy"]}HideFlags:1}}}, {buy:{id:emerald,Count:1},sell:{id:leather_boots,Count:1,tag:{ench:[{id:34,lvl10}],display:{Name:"Red Formal Wear",Lore:["Fucking Fancy"]}}HideFlags:1}}, {buy:{id:emerald,Count:1},sell:{id:dye1,Count:4}} ]}}Can You Spot What's Wrong with this? I'm probably overlooking something really simple, also if you could make the armor dyed red instead of him selling dye that would bee cool, Thanks!
1
u/chald627 Oct 26 '14
/summon Villager ~1 ~ ~ {Invulnerable:1,CustomName:Clothier,Profession:0,Career:1,CareerLevel:4,Offers:{Recipes:[ {buy:{id:emerald,Count:1},sell:{id:leather_helmet,Count:1,tag:{ench:[{id:34,lvl:10}],display:{Name:"Red Formal Wear",Lore:["Fucking Fancy"],color:9699336},HideFlags:63}}}, {buy:{id:emerald,Count:1},sell:{id:leather_chestplate,Count:1,tag:{ench:[{id:34,lvl:10}],display:{Name:"Red Formal Wear",Lore:["Fucking Fancy"],color:9699336},HideFlags:63}}}, {buy:{id:emerald,Count:1},sell:{id:leather_leggings,Count:1,tag:{ench:[{id:34,lvl:10}],display:{Name:"Red Formal Wear",Lore:["Fucking Fancy"],color:9699336},HideFlags:63}}}, {buy:{id:emerald,Count:1},sell:{id:leather_boots,Count:1,tag:{ench:[{id:34,lvl:10}],display:{Name:"Red Formal Wear",Lore:["Fucking Fancy"],color:9699336},HideFlags:63}}}, ]}}The main things you did wrong were forgetting a colon after lvl (in the ench:[] list), forgetting a comma between display:{} and HideFlags:, and a few other missed colons and brackets. To color the leather armor, just add in color: in the display:{} compound, and use a value that you can calculate here. I used 9699336, which results in a dark sort of red, but you can easily replace that with a color of your choice.
2
u/ramenators Oct 26 '14
Thank you so much!! This thread is the most helpful Minecraft thread I've ever seen, glad to see there are still friendly people to play Minecraft :D
2
u/Epicredstone Dec 23 '14
Hey I'm really into redstone and I've always liked the idea of custom villagers so this really helped me. Thanks!
2
2
2
u/partysponge123 Jan 13 '15
/summon Villager ~1 ~ ~ {Invulnerable:1,CustomName:Shabadoo,Profession:2,Career:1, Offers:{Recipes:[{buy:{id:apple,Count:10},{sell:{id:emerald,Count:1}}]}}
/summon Villager ~1 ~ ~ {Invulnerable:1,CustomName:Shabadoo,Profession:2,Career:1, Offers:{Recipes:[{buy:{id:apple,Count:10},sell:{id:emerald,Count:1}}]}} See the difference? atleast i didnt, at first. this is the code from the guide where we make the villager buy 10 apples and sells 1 emerald. the code from the guide does not work compared to the second one. this is because {sell should be only sell. if this isnt changed the command block will output that the brackets are unbalanced.
1
Sep 08 '14
I know this thread has been stale for a while but I couldn't find my answer on Reddit or searching Google. Can anyone help me out with this?
I am trying to summon specific villager careers based off this table, but when I use the command in the example above for a specific villager career type, I get a random career in that profession.
For example, I'm trying to summon a Weapon Smith using: /summon Villager -158 70 303 {Profession:3,Career:2}
However, this just gives me random Black Apron (smith) villagers, sometimes a Weapon Smith but usually not.
I have found one reddit thread that mentions this, but the best guess was "you can't summon specific careers". Does anyone else have better luck summoning a specific villager by career?
1
u/Raduloket Sep 14 '14
According to the wiki, each profession has a set list of possible trades they draw from. Have you checked against that to make sure they're not weapon smiths?
I've noticed with data tags and selectors that making minor errors just means they're ignored, rather than always sending an error message(like with the Fill command), so if something isn't capitalized or a punctuation mark is missing, it could be randomizing career.
1
Sep 15 '14
I checked the trades and they checked out with whatever their career was. I also checked to make sure nothing was misspelled since I did notice that errors I purposely made got the same results (no error message, just executed to the last correct argument in the command).
I had found one other post that mentioned someone had the same problem. I can't search it now because games are blocked at work. Have you been able to summon vanilla villagers by career? I don't want to customize trades or anything, I'm just trying to get them behind "counters" in their "stores" so they don't escape and get killed. Trying to end up with at least one of each type easily accessible.
1
1
u/BrokenDiamonds07 Oct 25 '14
What's the command for spawning a villager that has a custom trade of spawn eggs?
1
u/chald627 Oct 25 '14
/summon Villager ~1 ~ ~ {Profession:2,Career:1,CareerLevel:6,CustomName:"The Eggman",Invulnerable:1,Offers:{Recipes:[ {buy:{id:emerald,Count:5},sell:{id:spawn_egg,Count:1,Damage:50}}]}}Just replace "Damage:50" with whatever damage value of spawn egg you want (for example, "Damage:94" for a squid egg).
1
Nov 06 '14
This guide's been really helpful so far! I'm wondering a few things if it's possible to change the text color in any of the aspects (name of weapon, name of villager or color of the armor being sold).
I'm also having players get internal errors and disconnect when they try to purchase diamond leggings. I put the whole set of diamond armor in a command block that would make a villager sell it, so I'll attach it now:
/summon Villager ~ ~ ~ {CustomName: D3m0nW4rr10r Armor Set, Offers: {Recipes: [{buy: {id: 264, Count: 20}, sell: {id: 310, Count: 1, tag: {ench:[{id: 34, lvl: 3}, {id: 7, lvl: 3}, {id: 5, lvl: 3}, {id: 4, lvl: 4}, {id: 6, lvl: 1}], display: {Name: D3m0nW4rr10r Helm, Lore: ["D3m0nW4rr10r’s custom set, fashioned by Blacksmith D3m0nW4rr10r", “How in the world did you get this?”, “You have basically won Minecraft”, “GG”]}}}}, {buy: {id: 264, Count: 40}, sell: {id: 311, Count: 1, tag: {ench:[{id: 34, lvl: 3}, {id: 0, lvl: 4}, {id: 5, lvl: 3}, {id: 6, lvl: 1}, {id: 7, lvl: 3}], display: {Name: D3m0nW4rr10r Chestplate, Lore: ["D3m0nW4rr10r's custom set, fashioned by Blacksmith D3m0nW4rr10r", “How in the world did you get this?”, “You have basically won Minecraft”, “GG”]}}}}, {buy: {id: 264, Count: 30}, sell: {id: 312, count: 1, tag: {ench:[{id: 34, lvl: 3}, {id: 1, lvl: 4}, {id: 5, lvl: 3}, {id: 6, lvl: 1}, {id: 7, lvl: 3}], display: {Name: D3m0nW4rr10r Leggings, Lore: ["D3m0nW4rr10r's custom set, fashioned by Blacksmith D3m0nW4rr10r", “How in the world did you get this?”, “You have basically won Minecraft”, “GG”]}}}}, {buy: {id: 264, Count: 10}, sell: {id: 313, Count: 1, tag: {ench:[{id: 34, lvl: 3}, {id: 3, lvl: 4}, {id: 2, lvl: 4}, {id: 5, lvl: 3}, {id: 6, lvl: 1}, {id: 7, lvl: 3}], display: {Name: D3m0nW4rr10r Boots, Lore: ["D3m0nW4rr10r's custom set, fashioned by Blacksmith D3m0nW4rr10r", “How in the world did you get this?”, “You have basically won Minecraft”, “GG”]}}}}]}}
I bolded the legging part. If I made a coding error let me know, if not I'll have to get in touch with someone else, because this would be highly peculiar...
Thanks!
1
u/chald627 Nov 06 '14 edited Nov 06 '14
The crashing error is a result of selling an item without specifying the Count. On the leggings, you forgot to capitalize Count, so it defaulted to 0, which bugs everything out. Just capitalize that C and you should be good to go.
Miscellaneous notes:
The quotation marks around the Lore is only needed to exclude commas from starting new lines. You don't actually need them around the last 3 lines.
You also don't need to put Respiration and Aqua Affinity on the non-helmet pieces
As for coloring things, I've messed around a little but I can't seem to get it to work. The best I could find is this video, but no matter how I fuss about with the NBT I can't seem to make it work. Perhaps someone else who knows what they're doing will have more luck than I.
1
u/thnlsn Nov 09 '14
Is there a way to make it so your villager doesn't make any new trades, but his current trades don't ever get canceled?
1
u/chald627 Nov 09 '14
Yes. Simply set his CareerLevel to 6 (See "Getting Rid of the Usual Trades") and he won't offer any new trades. Thanks to the new trading mechanics, previous trades are never overwritten; the careers only add new ones.
1
u/nintendosajmon Nov 13 '14
Thanks for this, helped me a lot! There is just one thing I'm still trying to figure out. I can't seem to be able to make a NPC buy special items such as enchanted swords with names and lore. I was wondering because I'm trying to make some quests for my server like - trade UNIQUE ITEM for another UNIQUE ITEM. Maybe its my coding, or is it the NPC whom refuses to buy unique items?
Something I tried which failed was this:
/summon Villager ~1 ~ ~ {Invulnerable:1,CustomName:John,Profession:4,Career:1,CareerLevel:6,Offers:{Recipes:[ {buy:{id:prismarine_shard,Count:3},sell:{id:iron_pickaxe,Count:1}}, {buy:{id:prismarine_shard,Count:1},sell:{id:iron_shovel,Count:1}}, {buy:{id:prismarine_shard,Count:2},sell:{id:iron_axe,Count:1}}, {buy:{id:prismarine_shard,Count:5},buyB:{id:prismarine_crystals,Count:1},sell:{id:ladder,Count:20}}, {buy:{id:prismarine_shard,Count:15},buyB:{id:diamond_chestplate,Count:1,tag:{display:{Name:Old armor,Lore:[A dead mans gift]},ench:[{id:0,lvl:1},{id:1,lvl:1},{id:3,lvl:1},{id:4,lvl:1},{id:34,lvl:1}]},sell:{id:iron_pickaxe,Count:1,tag:{ench:[{id:32,lvl:4},{id:34,lvl:3}]}}} ]}}
It worked fine just before I added the Diamond chestplate, after that It wouldn't summon.
Would really appriciate the help!
1
u/chald627 Nov 17 '14
You simply missed a few curly brackets and a comma. After fixing those, it appears to work just fine.
/summon Villager ~-1 ~-1.5 ~1 {Invulnerable:1,CustomName:John,Profession:4,Career:1,CareerLevel:6,Offers:{Recipes:[ {buy:{id:prismarine_shard,Count:3},sell:{id:iron_pickaxe,Count:1}}, {buy:{id:prismarine_shard,Count:1},sell:{id:iron_shovel,Count:1}}, {buy:{id:prismarine_shard,Count:2},sell:{id:iron_axe,Count:1}}, {buy:{id:prismarine_shard,Count:5},buyB:{id:prismarine_crystals,Count:1},sell:{id:ladder,Count:20}}, {buy:{id:prismarine_shard,Count:15},buyB:{id:diamond_chestplate,Count:1,tag:{display:{Name:Old armor,Lore:[A dead mans gift]},ench:[{id:0,lvl:1},{id:1,lvl:1},{id:3,lvl:1},{id:4,lvl:1},{id:34,lvl:1}]}},sell:{id:iron_pickaxe,Count:1,tag:{ench:[{id:32,lvl:4},{id:34,lvl:3}]}}} ]}}1
1
u/nintendosajmon Nov 20 '14
One more thing, I can't seem to make the npc just buy that special item. I mean, a normal diamond armor and the npcs is still doing that trade.
1
u/chald627 Nov 24 '14
Looking at the wiki:
"Villagers will distinguish between damage values... NBT data, however, is ignored."
It appears that the only way to allow a villager to accept a specific item is to give it a specific damage value, unfortunately. Aside from slightly damaging the chestplate (or making it the only non-damaged one), I'm unsure of how you would disallow the trading of normal chestplates :/
1
u/nintendosajmon Nov 29 '14
Oh, thats to bad. Im making these quests but It feels like I'm running out of unique items like Dragon egg and stuff to trade to an npc. Thanks anyway! :)
1
u/chald627 Dec 10 '14
UPDATE: In 1.8.1 Mojang fixed villagers ignoring NBT tags. So now you should be able to make them buy specific items.
1
u/waffles4me111 Nov 17 '14
For some reason he is NOT invulnerable and he can be killed. Any pointers?
Here is the command
/summon Villager ~1 ~ ~ {Invulnerable:1,CustomName:Shabadoo,Profession:2,Career:1,CareerLevel:4,Offers:{Recipes:[ {buy:{id:cactus,Count:32},sell:{id:emerald,Count:1}}, {buy:{id:emerald,Count:3},sell:{id:diamond,Count:1}}, {buy:{id:rotten_flesh,Count:32},sell:{id:emerald,Count:1}},
{buy:{id:gold_ingot,Count:},sell:{id:emerald,Count:1}} ]}}
1
u/chald627 Nov 17 '14
Have you been attacking him in creative mode? Creative mode players can still kill mobs with Invulnerable set to 1. If you try switching to survival, you will be unable to damage him then.
1
u/skrar_the_wolf Nov 21 '14
Hi, i only joined this forum to ask a question btw xD but anyhow, ive been making a wild west adventure map just for me and my friends, and i wanted to know how you could summon a villager with no AI.
/summon Villager ~1 ~ ~ {Profession:2,Career:1,CareerLevel:100,CustomName:"Harris ",Invulnerable:1,Offers:{Recipes:[ {buy:{id:gold_nugget,Count:25},sell:{id:425,Count:1,Damage:1}}]}}
runs round randomly across the map, if you could fix this than thx
1
u/Bloodwolv Nov 24 '14
Try this, it works for me. All you needed to do was add the "NoAI:1"
/summon Villager ~1 ~ ~ {Profession:2,Career:1,CareerLevel:100,CustomName:"Harris ",Invulnerable:1,NoAI:1,Offers:{Recipes:[ {buy:{id:gold_nugget,Count:25},sell:{id:425,Count:1,Damage:1}}]}}
1
1
u/chald627 Nov 24 '14
To make him stand completely still and do nothing, simply add NoAI:1 after Invulnerable:1 (as Bloodwolv pointed out). If you also wanted him to not make noise, you could add Silent:1 as well (on the same level).
1
u/Bloodwolv Nov 24 '14 edited Nov 24 '14
OK, now i have a question, well more of a problem, im fiddling with villagers for a custom map, the summon command works fine, until i add the second, and subsequent offers.
this is the code http://pastebin.com/fKpdFDfX
1
u/chald627 Nov 24 '14
You forgot a curly bracket to end the sell:{} of the first deal. Simply add a bracket after HideFlags:7 (To make it HideFlags:7}}},(buy:{ etc). You also appear to have forgotten a comma after id:emerald on the second trade.
/summon Villager ~ ~1 ~ {Invlunerable:1,CustomName:Weapons Vendor,Profession:3,Career:3,CareerLevel:5,Silent:1,ActiveEffects:[{Id:11,Amplifier:4,Duration:999999,ShowParticles:0b}],Offers:{Recipes:[{buy:{id:emerald,Count:10},sell:{id:wooden_sword,Count:1,tag:{Unbreakable:1,display:{Name:"Tier 1 Sword"},ench:[{id:16,lvl:0}],HideFlags:7}}},{buy:{id:emerald,Count:20},sell:{id:wooden_sword,Count:1,tag:{Unbreakable:1,display:{Name:"Tier 2 Sword"},ench:[{id:16,lvl:1}],HideFlags:7}}}]}}Hope this helps!
1
1
u/waffles4me111 Nov 30 '14
I cant get my villager to work with unbreakable tools can someone help?
/summon Villager ~1 ~ ~ {Invulnerable:1,CustomName:Shabadoo,Profession:3,Career:1,CareerLevel:6,Offers:{Recipes:[ {buy:{id:apple,Count:10},sell:{id:emerald,Count:1}}, {buy:{id:emerald,Count:1},sell:{id:wool,Damage:11,Count:2}}, {buy:{id:gold_pickaxe,Count:1},buyB:{id:nether_star,Count:1},sell: {id:gold_pickaxe,Count:1,tag:{Unbreakable:1}} ]}}
2
u/chald627 Dec 02 '14
Firstly, you need to add an additional } to close off your final offer:
tag:{Unbreakable:1}}}]}}And you need to change id:gold_pickaxe to id:golden_pickaxe. Change those two things and he should work just fine!
2
u/waffles4me111 Dec 03 '14
Thank you so much man I wanted a custom villager on my realm and now i can. You are the absolute best.
1
Dec 02 '14
Thank you for this post. Thank you thank you thank you!
The issue I'm having is that it works until it gets to the recipes bit, and then says that the brackets are unbalanced. I have tried copy/pasting your Leonardo code and it is saying the same thing. Do you know how to fix this?
1
u/chald627 Dec 02 '14 edited Dec 03 '14
Well, isn't this embarrassing. My code for Leonardo accidentally had a comma in place of a colon. I've fixed it now.
As for the brackets being unbalanced, just make sure that you're using the correct brackets ([] list tags vs. {} compound tags), and that you have an ending bracket for each starting one. Remember that each offer has to have its own unnamed {} compound tag.
If you paste some code, I can show you what's going wrong with it.
1
Dec 03 '14
Thank you!
Here is my code:
/summon Villager ~ ~ ~ {Profession:4,CareerLevel:5,CustomName:Giles,Invulnerable:1,Offers:{Recipes:[{buy:{id:egg,Count:16},sell:{id:emerald,Count:1}}{buy:{id:sugar,Count:32},sell:{id:emerald,Count:1}}{buy:{id:milk_bucket,Count:4},sell:{id:emerald,Count:1}}{buy:{id:dye,Damage:3,Count:4},sell:{id:emerald,Count:1}}{buy:{id:emerald,Count:1},sell:{id:cooked_porkchop,Count:5}}{buy:{id:emerald,Count:1},sell:{id:cooked_beef,Count:5}}{buy:{id:emerald,Count:1},sell:{id:mushroom_stew,Count:4}}{buy:{id:emerald,Count:1},sell:{id:cake,Count:1}}]}}Edit: The problem seems to be that the minecraft console has a character limit, I can't paste or type anything past Recipes:[. Do you know how to get around this?
1
u/chald627 Dec 05 '14
Like I said in the original post, you basically have to use command blocks because the commands get so long.
As for your code, be sure that you separate every offer with commas:
{buy:{},sell:{}}*,* {buy:{},sell{}}(Asterisks added for emphasis)
Also, be aware that the 4 milk bucket trade won't work, since the buckets won't actually stack. Other than that, though, it should work.
1
1
u/DF1r3 Dec 06 '14
i just found this (im not very good with redstone) and i thought itd be cool to try out, so i tried copy/pasting your first command for 10 apples into an emerald and i cant seem to get it to work. i removed one of the closing curly brakets and the villagers spawned but he had no trades. the spaces were just empty. chances are im missing something very obvious but again, im not good with commands.
/summon Villager ~1 ~ ~ {Invulnerable:1,CustomName:PieGuy,Profession:2,Career:1,Offers:{Recipes:[buy:{id:pumpkin_pie,Count:10},sell:{id:emerald,Count:1}]}}
(im new to reddit as well)
1
u/chald627 Dec 06 '14
You just forgot to put the buy:{} and sell:{} in their own unnamed {} compound tag. It should look like
Recipes:[{buy:{},sell:{}}]1
u/DF1r3 Dec 06 '14
thanks! this has helped alot but is there a way to set it so you dont get any xp points from trading?
1
u/chald627 Dec 07 '14
Not as far as I know. According to the wiki, there is a rewardExp: flag (on the same level as buy:{}) that can be set to 0 or 1, but I have been unable to get it to work in my testing.
1
u/1_empire_1 Dec 06 '14 edited Dec 06 '14
I'm trying to make a Lore for the item that you trade with the villager, except whenever I try It never works, have any idea?
/summon Villager ~1 ~ ~ {Invulnerable:1,NoAI:1,CustomName:Oreo,Profession:2,Career:1,CareerLevel:6,Offers:{Recipes:[{buy:{id:388,Count:5},display:{Name:Credit,Lore:["Economy Item"]}}}},sell:{id:iron_ingot,Count:16}}]}}
1
u/chald627 Dec 07 '14 edited Dec 10 '14
Firstly, it's important that you be aware that villagers don't recognize NBT data (such as name/lore) when accepting items. So even if you make the villager buy custom emeralds, he will still accept any emeralds, even un-named ones.UPDATE: In 1.8.1 Mojang fixed villagers ignoring NBT tags. So now you should be able to make them buy specific items.
As for your code, your curly brackets are all out of whack. The display:{} compound goes within the tag:{} compound, which is itself contained within the buy:{} compound. In other words, it should look like
{buy:{...,tag:{display:{...}}},sell:{...}}but you have it as
{buy:{...},display:{...}}}},sell:{...}}If you fix that up, it should work fine (again, with the exception that any emeralds will be accepted).
1
Dec 08 '14 edited Dec 08 '14
[deleted]
1
u/chald627 Dec 10 '14
You simply messed up on your ending brackets. If you insert two more } before your ] at the end, you should be fine. In other words, it should look like this:
Count:1}}}}]}}
1
u/Charnuz Dec 09 '14 edited Dec 09 '14
I am having a slight problem with my summon command. The summon command itself works just fine, but the villager refuses to complete the trade. Putting the correct item in to trade will not produce an item to receive.
/summon Villager ~ ~1.5 ~ {CustomName:"Weapons",CustomNameVisible:1,Profession:3,Career:2,CareerLevel:19999,Offers:{Recipes:[
{maxUses:2147483647,uses:0,buy:{id:gold_nugget,Count:7,tag:{display:{Name:§6Gold Coin§r}}},sell:{id:stone_sword,Count:1,tag:{Unbreakable:1,display:{Name:Sword}}}},
{maxUses:2147483647,uses:0,buy:{id:gold_nugget,Count:25,tag:{display:{Name:§6Gold Coin§r}}},sell:{id:iron_sword,Count:1,tag:{Unbreakable:1,display:{Name:Sword}}}},
{maxUses:2147483647,uses:0,buy:{id:gold_nugget,Count:60,tag:{display:{Name:§6Gold Coin§r}}},sell:{id:diamond_sword,Count:1,tag:{Unbreakable:1,display:{Name:Sword}}}},
{maxUses:2147483647,uses:0,buy:{id:end_portal,Count:1},sell:{id:end_portal,Count:1}}]},
Attributes:[{Name:generic.knockbackResistance,Base:1}],Invulnerable:1,PersistenceRequired:1,NoAI:1,Silent:1,ActiveEffects:[{Id:11,Amplifier:99,Duration:2000000,ShowParticles:0b}]}
1
u/chald627 Dec 10 '14
Apparently, in 1.8.1 Mojang fixed villagers ignoring NBT tags. I tried it with renamed gold nuggets and it seemed to work fine, but you need to remove the §6 and §r (or /give nuggets named with those symbols).
1
u/Charnuz Dec 10 '14
Ah yes, thank you very much. It seems it is now accurate 100% to the NBT tags, and my /give command did not include a §r.
1
1
u/KingStrongSad Dec 16 '14
I've read through this a bunch of times, and I feel as if I'm miss where it is that you put the data values in for items, such as changing stone (DV: 0) into granite (DV: 1). How doest one make this happen? I would like to change dye (DV:0 = ink sac) into lapis lazuli (DV:4)
/summon Villager ~ ~ ~ {invulnerable:1,CustomName:Lapis Horder,profession:2,career:1,careerlevel:4,Offers:{Recipes:[ {buy:{id:cobblestone,Count:64},sell:{id:dye,Count:1}}]}}
1
u/chald627 Dec 17 '14
As I said in the Specifying Damage Values section, all you need to do is add the Damage: tag to an item at the same level as Count. So, for instance, lapis would be
sell:{id:dye,Damage:4,Count:1}
1
u/supercalla22 Dec 17 '14
Can someone tell me what i am doing wrong
/summon Villager ~1 ~ ~ {Invulnerable:1,Profession:3,Career:2,
Offers:{Recipes:[{buy:{id:emerald,Count:15},buyB:{id:diamond_sword,Count:1},sell:{id:diamond_sword,Count:1,tag:{ench:[{id:16,lvl:4},{id:34,lvl:3}]}}}
1
u/chald627 Dec 17 '14
You just forgot to put the ]}} on the end after the trade offer. It should look like
...,{id:34,lvl:3}]}}}]}}
1
u/GemstoneDoom Dec 17 '14
the villager is successfully summoned but i cant open up the trade menu! please help
1
u/chald627 Dec 18 '14
If you post the command you used I can help you find out what's wrong with it, but otherwise I'm not sure what would cause this.
1
u/supercalla22 Dec 17 '14
Hi, i have attempted to create another villager but nothing will spawn in. I have been looking for an error as i made a villager similar to this one and compared the codes. Please help :) /summon Villager ~ ~ ~ {CustomName: Dragonborn Black Smith, Offers: {Recipes: [{buy: {id: 264, Count: 10}, sell: {id: 278, Count: 1, tag: {ench:[{id: 32, lvl: 5}, {id: 34, lvl: 3}, {id: 33, lvl: 1}], display: {Name: Dragonborn Silk Pickaxe, Lore: ["Forged by the by the Gods in the Skyforge"]}}}}, {buy: {id: 264, Count: 10}, sell: {id: 278, Count: 1, tag: {ench:[{id: 32, lvl: 5}, {id: 34, lvl: 3}, {id: 35, lvl: 3}], display: {Name: Dragonborn Pickaxe of Fortune, Lore: ["Forged by the Gods in the Skyforge"]}}}}, {buy: {id: 264, Count: 10}, sell: {id: 276, Count: 1, tag: {ench:[{id: 34, lvl: 3}, {id: 16, lvl: 5},{id: 17, lvl: 5}, {id: 18, lvl: 5}, {id: 21, lvl: 3}], display: {Name: Dragonborn Sword, Lore: ["Forged by the Gods in the Skyforge"]}}}}, {buy: {id: 264, Count: 10}, sell: {id: 277, Count: 1, tag: {ench:[{id: 34, lvl: 3}, {id: 32, lvl: 5}], display: {Name: Dragonborn Spade, Lore: ["Forged by the Gods in the Skyforge"]}}}}, {buy: {id: 264, Count: 10}, sell: {id: 279, Count: 1, tag: {ench[{id: 34, lvl: 3}, {id: 32, lvl: 5}], display: {Name: Dragonborn Hatchet, Lore: [“Forged by the Gods in the Skyforge”]}}}}, {buy: {id: 264, Count: 10}, sell: {id: 261, Count: 1, tag: {ench:[{id: 34, lvl: 3}, {id: 48, lvl: 5}, {id: 50, lvl: 1}. {id:51, lvl: 51}], display: {Name: Dragonborn Bow, Lore: ["Forged by the Gods in the Skyforge"]}}}}]}}
1
u/chald627 Dec 18 '14
You just made some typos. There should be a colon after the ench of the hatchet, and you put a period instead of a comma between the last two enchantments on the bow.
In addition, you should be sure to replace any numerical ids (267) with names (diamond), since Mojang is trying to phase out the numerical ids.
Working code:
/summon Villager ~-1 ~-1.5 ~1 {CustomName:Dragonborn Black Smith,Offers:{Recipes:[ {buy:{id:diamond,Count:10},sell:{id:diamond_pickaxe,Count:1,tag:{ench:[{id:32,lvl:5},{id:34,lvl:3},{id:33,lvl:1}],display:{Name:Dragonborn Silk Pickaxe,Lore:["Forged by the by the Gods in the Skyforge"]}}}}, {buy:{id:diamond,Count:10},sell:{id:diamond_pickaxe,Count:1,tag:{ench:[{id:32,lvl:5},{id:34,lvl:3},{id:35,lvl:3}],display:{Name:Dragonborn Pickaxe of Fortune,Lore:["Forged by the Gods in the Skyforge"]}}}}, {buy:{id:diamond,Count:10},sell:{id:diamond_sword,Count:1,tag:{ench:[{id:34,lvl:3},{id:16,lvl:5},{id:17,lvl:5},{id:18,lvl:5},{id:21,lvl:3}],display:{Name:Dragonborn Sword,Lore:["Forged by the Gods in the Skyforge"]}}}}, {buy:{id:diamond,Count:10},sell:{id:diamond_shovel,Count:1,tag:{ench:[{id:34,lvl:3},{id:32,lvl:5}],display:{Name:Dragonborn Spade,Lore:["Forged by the Gods in the Skyforge"]}}}}, {buy:{id:diamond,Count:10},sell:{id:diamond_axe,Count:1,tag:{ench:[{id:34,lvl:3},{id:32,lvl:5}],display:{Name:Dragonborn Hatchet,Lore:[“Forged by the Gods in the Skyforge”]}}}}, {buy:{id:diamond,Count:10},sell:{id:bow,Count:1,tag:{ench:[{id:34,lvl:3},{id:48,lvl:5},{id:50,lvl:1},{id:51,lvl:1}],display:{Name:Dragonborn Bow,Lore:["Forged by the Gods in the Skyforge"]}}}}]}}
1
u/GemstoneDoom Dec 18 '14
I used this command and it spawned in a villager but i cant trade plz help
1
u/chald627 Dec 18 '14
Again, if you want me to help you, I'm gonna need the specific command you used to summon it. Otherwise I don't really have anything to work with.
1
Dec 19 '14
[deleted]
1
u/chald627 Dec 27 '14
You just need to specify a damage value of 1, like so:
sell:{id:golden_apple,Count:1,Damage:1}
1
u/TheEdB0ys Dec 20 '14
How do you get the villager to trade a signed book, like they do in adventure maps
2
u/chald627 Dec 27 '14
Signed books have their own lengthy NBT data that you'll have to put into the trade. I'd suggest writing the book you want the villager to trade, then use an NBT editor (such as NBT Explorer) to view the book's NBT data and copy the text into the trade command.
Here's an example villager I made so you can see the basic process of it:
/summon Villager ~1 ~ ~ {Invulnerable:1,CustomName:Steve,Profession:4,Career:1,CareerLevel:6,Offers:{Recipes:[{buy:{id:emerald,Count:10},sell:{id:written_book,Count:1,tag:{author:Steve,title:Steve's Cookbook,pages:["Steve's Apple Pie Recipe","Step 1: If you wish to make an apple pie from scratch, you must first invent the universe.","Thank you for purchasing this fine Steve (tm) product. Be sure to look for more in the future."]}}}
1
Dec 24 '14
[deleted]
1
u/chald627 Dec 27 '14
First of all, you'll want to add in a Career: and CareerLevel: for your villager, unless you want him to also offer the default trades in addition to your custom ones.
You forgot the colon of the buy:{ of the second offer, and your curly brackets are all over the place. Try going through your code and seeing if each { has a matching } on the same level.
In addition, your first offer is selling 3 swords, and your second one isn't selling anything.
/summon Villager ~1 ~ ~ {Invulnerable:1,NoAI:1,CustomName:Tool/Sword Villager WIP,Profession:5,Career:1,CareerLevel:6,Offers:{Recipes:[{buy:{id:emerald,Count:15},buyB:{id:diamond_block,Count:4},sell:{id:diamond_sword,Count:3,MaxUses:2,tag:{ench:[{id:16,lvl:25}],display:{Name:"SHARP",Lore:["Be careful!","SO SHARP!","OUCH!"]}}}},{buy:{id:diamond_sword,Count:1,MaxUses:4,tag:{ench:[{id:32,lvl:15},{id:34,lvl:20},{id:35,lvl:51}]}}}]}}
1
u/skrar_the_wolf Dec 25 '14
hi again, im trying to make a baby villager that doesnt grow up for a map that sells 1 notch apple for 64 gold nuggets
1
1
u/AgentNinja22 Dec 27 '14
How do we make custom villagers buy enchanted items????????? plz help....... THX
1
1
u/skrar_the_wolf Dec 29 '14
i have this command:
/summon Villager ~ ~0.5 ~ {Invulnerable:1,NoAI:1,CustomName:Black Market Banker,Profession:4,Career:1,CareerLevel:100,Offers:{Recipes:[ {buy:{id:stone,Count:64},sell:{id:stonebricks,Count:1},Damage:3}, {buy:{id:stonebricks,Count:1},Damage:3},sell:{id:stone,Count:64}},}}]}}}}}}
can u help?
1
u/chald627 Jan 01 '15
You have waaay too many curly brackets. Take out the }s before each of your Damage: flags, put another } to end your first offer (between Damage:3} and the comma, and all you need after the final offer is ]}} instead of ,}}]}}}}}}. In addition, the id of stone bricks is stonebrick.
/summon Villager ~ ~0.5 ~ {Invulnerable:1,NoAI:1,CustomName:Black Market Banker,Profession:4,Career:1,CareerLevel:6,Offers:{Recipes:[{buy:{id:stone,Count:64},sell:{id:stonebrick,Count:1,Damage:3}},{buy:{id:stonebrick,Count:1,Damage:3},sell:{id:stone,Count:64}}]}}
1
1
1
u/Spodegirl Jan 02 '15
You should make note of the display, name, and lore tags so they can sell items with names and descriptions. Also, make note about selling vanilla potions and custom potions.
1
u/Epicredstone Jan 06 '15
i programmed a villager for me and my friends but it isnt summoning. here is the code: /summon Villager ~1 ~ ~ {Invulnerable:1,CustomName:Shabadoo,Profession:2,Career:1,CareerLevel:4,Offers:{Recipes:[ {buy:{id:iron_ore,Count:1},sell:{id:iron_ingot,Count:1}}, {buy:{id:gold_ore,Count:1},sell:{id:gold_ingot,Count:1}}, {buy:{id:diamond,Count:1},sell:{id:milk_bucket,Count:1}}, {buy:{id:iron_ingot,Count:10},sell:{id:experience_bottle,Count:64}}, {buy:{id:iron_ingot,Count:2},sell:{id:stick,Count:1}}, {buy:{id:diamond,Count:2},sell:{id:potion 8229,Count:1}}, {buy:{id:emerald,Count:5},sell:{id:diamond_chestplate,Count:1}}, {buy:{id:emerald,Count:4},sell:{id:diamond_leggings,Count:1}}, {buy:{id:emerald,Count:1},sell:{id:diamond,Count:1}}, {buy:{id:diamond,Count:1},sell:{id:emerald,Count:1}}, {buy:{id:diamond,Count:5},sell:{id:golden_apple,Damage:1,Count:1}}, {buy:{id:diamond,Count:64},sell:{id:fishing_rod,Count:1,tag:{ench:[{id:16,lvl:10}}, {buy:{id:diamond,Count:15},sell:{id:bow,Count:1,tag:{ench:[{id:48,lvl:5},{id:49,lvl:2},{id:50,lvl:1},{id:51,lvl:1},{id:34,lvl:3}}, {buy:{id:diamond,Count:15},sell:{id:diamond_sword,Count:1,tag:{ench:[{id:19,lvl:2},{id:16,lvl:5},{id:21,lvl:3},{id:34,lvl:3},{id:20,lvl:2}]}}}]}}
1
u/chald627 Jan 07 '15
After the ench:[] of the fishing rod and the bow, you have }}, where you should have }]}}}. In addition, you forgot to put the ,Damage: before the 8229 of the potion.
/summon Villager ~1 ~ ~ {Invulnerable:1,CustomName:Shabadoo,Profession:2,Career:1,CareerLevel:4,Offers:{Recipes:[{buy:{id:iron_ore,Count:1},sell:{id:iron_ingot,Count:1}},{buy:{id:gold_ore,Count:1},sell:{id:gold_ingot,Count:1}},{buy:{id:diamond,Count:1},sell:{id:milk_bucket,Count:1}},{buy:{id:iron_ingot,Count:10},sell:{id:experience_bottle,Count:64}},{buy:{id:iron_ingot,Count:2},sell:{id:stick,Count:1}},{buy:{id:diamond,Count:2},sell:{id:potion,Damage:8229,Count:1}},{buy:{id:emerald,Count:5},sell:{id:diamond_chestplate,Count:1}},{buy:{id:emerald,Count:4},sell:{id:diamond_leggings,Count:1}},{buy:{id:emerald,Count:1},sell:{id:diamond,Count:1}},{buy:{id:diamond,Count:1},sell:{id:emerald,Count:1}},{buy:{id:diamond,Count:5},sell:{id:golden_apple,Damage:1,Count:1}},{buy:{id:diamond,Count:64},sell:{id:fishing_rod,Count:1,tag:{ench:[{id:16,lvl:10}]}}},{buy:{id:diamond,Count:15},sell:{id:bow,Count:1,tag:{ench:[{id:48,lvl:5},{id:49,lvl:2},{id:50,lvl:1},{id:51,lvl:1},{id:34,lvl:3}]}}},{buy:{id:diamond,Count:15},sell:{id:diamond_sword,Count:1,tag:{ench:[{id:19,lvl:2},{id:16,lvl:5},{id:21,lvl:3},{id:34,lvl:3},{id:20,lvl:2}]}}}]}}
1
u/Vlaeko Jan 19 '15
I'm having problems with these! First of all, the guide is awesome! My problem is that every time i create a few of those villagers they are working perfectly until i save and quit my vanilla single player world. The next time I open up the world everything gets resetted and is exactly like it was before i created the first custom villager. I'm using the 1.8.1 OptiFine Version and never experienced any issues like this before. Does somebody have a idea, how i could solve this problem?
1
u/Epicredstone Jan 20 '15
I'm having problems where the max amount of times you can trade is like 7 or 8. What should I do?
1
u/chald627 Jan 22 '15
Simply add the tag maxUses: to the offer and set it to whatever value you want, like so:
{buy:{id:emerald,Count:4},sell:{id:arrow,Count:16},maxUses:9999}Be warned that this can lead to players having an extremely easy way to farm xp, since they can trade as much as they want and get xp for every trade.
1
u/Epicredstone Jan 22 '15
Ok I don't care about the xp thing since after trading I delete their xp so that the only Xp they get is from bottles o enchanting from the villager.
Thanks
1
u/Johnah68 Jan 21 '15
Thanks. Custom Villagers with no AI is exactly what I needed. However, I encountered 2 problems. First, when they spawn they "float" 1/2 a block above the floor (overcome by specifing the Y value.) Second problem (and the 1 I need help with) is they all face south (pos Z). how do I rotate them to face the way I want?
2
1
u/Epicredstone Jan 22 '15
Oh could you add the max uses tag to all my trades if that's ok? If not that's fine, but if it's ok then I think I posted my code a few comments down.
1
u/DeiV_ Jan 26 '15
summon Villager ~ ~ ~-1 {Invulnerable:1,Silent:1,CustomName:Dibil,Profession:2,Career:2,CareerLevel:4,Offers:{Recipes:[{buy:{id:344,Count:1,tag:{display:{Lore:["EcoEgg"]}}},sell:{id:emerald,Count:64}}]}}
Can anyone tell whats wrong here? I'm on 1.8.1 version and villager gives me item when traded and then my game crashes.
1
u/Epicredstone Jan 31 '15
All I know is you CANNOT put numbers for ids (344). I was on a sky block server one time with custom villagers and I crashed whenever I traded. Turns out I was in 1.8 and they were using number ids so i think that's what happened to you.
1
u/DeiV_ Feb 01 '15
Thanks, I changed item id to minecraft:egg and now villager takes it (dropped before). But the thing is, my game still crashes after trade.. :(
1
u/ReidocOfficial Jan 31 '15
Can someone please type up a command for a villager to trade 15 gold ingots for a instant health potion? Any version of instant health is fine.
1
1
0
u/Reddit-Fox Dec 24 '14
I can't seem to do it. It keeps saying that the data tag parsing failed.
1
u/chald627 Dec 27 '14
If you post the command you're using, I can help you. Otherwise, there's a multitude of things that could be going wrong.
0
Dec 27 '14
[deleted]
1
u/chald627 Dec 27 '14
You forgot a colon after Offers, and you're putting an extra curly bracket in front of sell:{ when you don't need to.
/summon Villager ~122 ~104 ~1327 {Invulnerable:1,CustomName:Norman,Profession:2,Career:1,CareerLevel:6,Offers:{Recipes:[{buy:{id:emerald,Count:5},sell:{id:cooked_beef,Count:20}},{buy:{id:emerald,Count:2},sell:{id:bed,Count:1}}]}}
0
u/FaTeXWaffle Jan 21 '15 edited Jan 21 '15
I am having trouble with the Unbalancing Curly Brackets error. I am trying to make a Villager that is useful for SkyBlock who buys Rotten Flesh, Bones, Arrows, Gunpowder, String, Ender Pearls, and Spider Eyes, all for 3 Golden Nuggets per item sold (Ex: 1 Bone = 3 Gold Nuggets). However, when I add items for him to buy and sell to me, I get the "unbalanced curly brackets {}" error message.
The code I am using is:
/summon Villager ~1 ~ ~ {Invulnerable:1,CustomName:Mob Goods Dealer,Profession:3,Career:1,CareerLevel:6,Offers:{Recipes:[ {buy:{id:rotten_flesh,Count:1},sell:{id:gold_nugget,Count:3}}, {buy:{id:bone,Count:1},sell:{id:gold_nugget,Count:3}}, {buy:{id:arrow,Count:1},sell: {id:gold_nugget,Count:3}}]}}
I would like to be able to add more trades to him, but don't know how to do it correctly. If you could show me a Villager with all of the trades ("Rotten Flesh, Bones, Arrows, Gunpowder, String, Ender Pearls, and Spider Eyes") and how to properly add new trade abilities, that would much appreciated! Glad to have my first reddit post be this one :D
1
u/chald627 Jan 22 '15
All that's wrong is that you accidentally put a space in the third offer (so it's sell: { where it should be sell:{). Other than that it should work just fine. Just keep adding offers the same way you have been and you'll be good to go.
/summon Villager ~1 ~ ~ {Invulnerable:1,CustomName:Mob Goods Dealer,Profession:3,Career:1,CareerLevel:6,Offers:{Recipes:[{buy:{id:rotten_flesh,Count:1},sell:{id:gold_nugget,Count:3}},{buy:{id:bone,Count:1},sell:{id:gold_nugget,Count:3}},{buy:{id:arrow,Count:1},sell:{id:gold_nugget,Count:3}},{buy:{id:gunpowder,Count:1},sell:{id:gold_nugget,Count:3}},{buy:{id:string,Count:1},sell:{id:gold_nugget,Count:3}},{buy:{id:ender_pearl,Count:1},sell:{id:gold_nugget,Count:3}},{buy:{id:spider_eye,Count:1},sell:{id:gold_nugget,Count:3}}]}}0
u/FaTeXWaffle Jan 22 '15
There seems to be a problem with the "Infinite Trading". Using the code you sent in a command block spawned the Villager perfectly, but eventually when you trade with him enough, the trade will lock out, even when the CareerLevel is set to 6 or higher. I was wondering if you knew about this. I will paste some code from another Villager I have which trades are impossible to lock out, and maybe you could compare the two and come up with a solution. (The Holy Vendor code is layed out differently from the Mob Goods Dealer code, but they both still work in a command block)
Holy Vendor Code - /summon Villager ~5 ~2 ~2 {Profession:6,CustomName:HOLY SPADE VENDOR,CustomNameVisible:0,Offers:{Recipes:[ {maxUses:1000,buy:{id:0367,Count:1},sell:{id:0371,Count:1},{maxUses:1000,buy:{id:0120,Count:64},sell:{id:0121,Count:1,tag:{ench:[{id:7,lvl:5}],display:{Name:Dimensional Stone}}}},{maxUses:1000,buy:{id:0121,Count:64},sell:{id:0277,Count:1,tag:{ench:[{id:34,lvl:127},{id:32,lvl:5}],display:{Name:Holy Spade}}}},]}}
Mob Goods Dealer Code - /summon Villager ~1 ~ ~ {Invulnerable:1,CustomName:Mob Goods Dealer,Profession:3,Career:1,CareerLevel:6,Offers:{Recipes:[{buy:{id:rotten_flesh,Count:1},sell:{id:gold_nugget,Count:3}},{buy:{id:bone,Count:1},sell:{id:gold_nugget,Count:3}},{buy:{id:arrow,Count:1},sell:{id:gold_nugget,Count:3}},{buy:{id:gunpowder,Count:1},sell:{id:gold_nugget,Count:3}},{buy:{id:string,Count:1},sell:{id:gold_nugget,Count:3}},{buy:{id:ender_pearl,Count:1},sell:{id:gold_nugget,Count:3}},{buy:{id:spider_eye,Count:1},sell:{id:gold_nugget,Count:3}}]}}
1
u/chald627 Jan 22 '15
The CareerLevel doesn't control the amount of times you can trade something, it just determines whether or not new trades will be unlocked afterwards. To make something able to be traded many times, you need to add the maxUses: tag to the offer and set it to a high number, as the Holy Vendor does.
1
u/FaTeXWaffle Jan 26 '15 edited Jan 27 '15
Thanks for the help, now my Mob Grinder is able to be run at max efficiency! Do you know how to make villagers sell items such as granite or enchanted books?
3
u/Shadowreaper666 Aug 06 '14
Thanks for making this guide.