Help With Custom Commands on villigers with a custom item 1.15.2
I was trying to get an emerald with a custom color added to it and have a villager sell the emerald. I was doing well getting both to spawn but when I tried to combine the two it didn't work. Can you tell me what I have done wrong?
/summon villager ~ ~1 ~ {VillagerData:{profession:farmer,level:2,type:plains},Offers:{Recipes:[{buy:{id:acacia_boat,Count:1},sell:{id:emerald,Count:1,tag:{display:{Name:"\"aqua\"",Lore:["\"TOKENNNN\""]}}},maxUses:9999999},{buy:{id:acacia_boat,Count:1},buyB:{id:acacia_boat,Count:1},sell:{id:emerald,Count:1,tag:{display:{Name:"\"Token\",\" color\":\"aqua\",\"italic\":true},{\"text\":\"ken\",\"color\":\"aqua\",\"italic\":true}]\",},HideFlags:1}\""}}},maxUses:9999999}]}}
And the expanded command:
/summon villager ~ ~1 ~
{
VillagerData:{ profession:farmer, level:2, type:plains },
Offers:{
Recipes:[
{
buy:{ id:acacia_boat, Count:1 },
sell:{ id:emerald, Count:1,
tag:{ display:{ Name:"\"aqua\"", Lore:[ "\"TOKENNNN\"" ] } }
},
maxUses:9999999
},
{
buy:{ id:acacia_boat, Count:1 },
buyB:{ id:acacia_boat, Count:1 },
sell:{ id:emerald, Count:1,
tag:{ display:{ Name:"\"Token\",\" color\":\"aqua\",\"italic\":true},{\"text\":\"ken\",\"color\":\"aqua\",\"italic\":true}]\",},HideFlags:1}\"" } }
},
maxUses:9999999
}
]
}
}
To specify the issue, it is only reading the "TOKEN" part of it and not the rest
Best Answer
Use this:
/summon villager ~ ~1 ~ {VillagerData:{profession:farmer,level:2,type:plains},Offers:{Recipes:[{buy:{id:acacia_boat, Count:1b},sell:{id:emerald,Count:1b,tag:{display:{Name:"\"aqua\"",Lore:["\"TOKENNNN\""]}}},maxUses:9999999},{buy:{id:acacia_boat, Count:1b},buyB:{id:acacia_boat, Count:1b},sell:{id:emerald,Count:1b,tag:{display:{Name:"[{\"text\":\"Token\",\"color\":\"aqua\",\"italic\":true},{\"text\":\"ken\",\"color\":\"aqua\",\"italic\":true}]"},HideFlags:1}},maxUses:9999999}]}}
Pictures about "Help With Custom Commands on villigers with a custom item 1.15.2"
How do you give someone a custom item in Minecraft?
Here's a handy workaround that lets you give items with custom names and enchantments....Original postHow do you give an item a custom name?
You can give a player any item whenever you want using the /give command in Minecraft.Setting up CUSTOM TRADES in Vanilla Minecraft 1.17! (Part 1)
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Jill Wellington, Ryutaro Tsukata, Albert Nunez, cottonbro