Minecraft – How do i make custom villagers that sells custom potions

minecraft-commandsminecraft-java-edition

I'm making a survival map, and now i'd like to add some custom villagers in a tower that can sell custom potions.

For example let's say you have a librarian, and he offers you a potion called: "Potion of Strengh"

That potion would give the player strengh 4, and it would have a duration of 60 sec.

I have tried to use 2 generators witin one site, and I used this following command:

/summon Villager ~1 ~ ~ {Profession:1,CustomName:"The First Wizard",CustomNameVisible:1,Career:1,CareerLevel:42,CanPickUpLoot:0,PersistenceRequired:1,Silent:1,Invulnerable:1,Attributes:[{Name:"generic.movementSpeed",Base:"0f"}],Offers:{Recipes:[{buy:{id:"emerald",Count:1},maxUses:9999999,sell:{id:"potion 1 0 {CustomPotionEffects:[{Id:5,Amplifier:5,Duration:600}],display:{Name:"Super Potion"}}",Count:1},rewardExp:false}]}}

But I only get within a message within the previous output that says:

[14:01:07] Data tag parsing failed: Unexpected token 'S' at: Super Potion"}}",Count:1

And keep in mind I used two generators from this website here to make the command.

Best Answer

Now I'm not a genius when it comes to command blocks so I can't tell you what is wrong but I remade your command and tested it in 1.9.2 (which worked) and by comparing my command and your command there is some differences.

/summon Villager ~ ~1 ~ {CustomName:"The First Wizard",CustomNameVisible:1,Profession:1,Career:1,CareerLevel:42,Offers:{Recipes:[{rewardExp:0b,maxUses:2147483647,uses:0,buy:{id:emerald,Count:1},sell:{id:potion,Count:1,tag:{display:{Name:"Super Potion"},CustomPotionEffects:[{Id:5,Amplifier:5,Duration:600}]}}}]},Attributes:[{Name:generic.movementSpeed,Base:0}],Invulnerable:1,PersistenceRequired:1,Silent:1}

The generator I made this with is

http://mcstacker.bimbimma.com/

It might be a bit confusing at first but it helps me make several of my commands. It even gives a description for all/most of the options it gives.

Hopes this helps!