User blog:JustJuuno/Villager Custom Trade Guides

This guide is dedicated to those who are trying to make their own villages with their own custom trades. This is very functional to MCPE 1.0.5 and it is safe, but it will take you a long time to code it.

<--->

Requirements
▪ Minecraft: Pocket Edition 1.0.5

▪ Adept knowledge of Commands

▪ Awareness of errors and command implementation (recommended)

▪ Command Blocks (any type)

Summoning the Initial Villager
First, take a look at the /summon command /summon Villager ~1 ~ ~ This will spawn a villager, but the career, the profession, and the trades will be random. Let's implement a longer code for the command: /summon Villager ~1 ~ ~ {Profession:2,Career:1} By specifying the NBT tags, this will summon a Cleric villager. This is where the first note comes in, as summoning a Villager with 2 as Profession, same as Career, will crash the game if attempting to trade with it.

Now, if we want to make the villager permanently living in your world, input this in the Command Block as things will start becoming longer than usual: /summon Villager ~1 ~ ~ {Invulnerable:1,CustomName:Squidward,Profession:2,Career:} That's the easy part of this. The reason why I named it "Squidward" is for entertainment, but if you don't do this, your Villager will despawn. However, you can name it to other stuff if you want. The fifth and second note will be applied from this point forth.

Adding a Trade
Now, you want to have your Villager some offers and junk so let's implement a lot more things in the command: /summon Villager ~1 ~ ~ {Invulnerable:1,CustomeName:Squidward,Profession:2,Career:1,Offers:{Recipes:[{buy:{id:apple,Count:10},sell:{id:diamond,Count:64}}]}} Now, that may look confusing or very confusing, but it is how to input it. Let's try to clarify this a bit: I used the Offers:{} compound tag, then we put the Recipes:[] list tag. Any trades you want to be added is recommended to be put inside the Recipes:[] tag. New trades themselves will be placed inside unnamed {} compound tags and divided into two components: buy:{} (cost of trade) and sell:{} (item given).

So it means that if we have ten apples, we can have Squidward to exchange it with us with a stack of diamonds.

Now, you can just do the first part of the /summon command because after this paragraph, I will only show what to add next.

Adding More Trades
Additional trades will also have to be inserted to the Recipes:[] list after the current trade. For example: Offers:{Recipes:[{buy:id:apple,Count:10},{sell:id:diamond,Count:64}},{buy:{id:emerald,Count:1},sell:{id:wool,Damage:11,Count:2}}]} This will give us 2 blue wool for an emerald.

Unfortunately, guys, I can cover up more of the info here but I can give you a link to the original source I got from. Thanks to "u/chald627" for the help. The link for the reddit post will be right below.

https://www.reddit.com/r/Minecraft/comments/2cqztd/a_guide_to_trading_and_setting_up_custom/

That's it for today, see ya! Also, have a happy trading :)