I'm creating a custom villager Trading with Custom Items. It is way more complicated, but this is the essence of my question. Thing is, when I use the code I made below my Villager trades look like this:
When the paper should look like this:
aka. enchanted and Named, and the Chicken should have a custom Name as well as a Lore. The second Trade is completely messed up, as nothing is showing at all, when there should be a trade "4 Drachma" for "1 Miles' Delicious Rabbit Stew".
VillagerData: {
profession: butcher,
level: 99,
type: plains
},
CustomName: "\"Butcher Miles\"",
NoAI: 1,
Invulnerable: 1,
Offers: {
Recipes: [
{
buy: {
id: "paper",
tag: {
display: {
Name: [
{
"text": "Drachma",
"color": "#ffff66"
}
],
Enchantments: [
{
id: fortune,
lvl: 1
}
],
Lore: [
{
"text": "Money, you use it to buy things.",
"italic": true,
"color": "white"
}
]
}
},
Count: 3
},
maxUses: 5,
sell: {
id: "cooked_chicken",
tag: {
display: {
Name: "Miles' Tasty Chicken Wings",
Lore: [
"Yummy!"
]
}
},
Count: 1
},
rewardExp: 0b
},
{
buy: {
id: "paper",
tag: {
display: {
Name: [
{
"text": "Drachma",
"color": "#ffff66"
}
],
Lore: [
{
"text": "Money, you use it to buy things.",
"italic": true,
"color": "white"
}
],
Enchantments: [
{
id: fortune,
lvl: 1
}
]
},
Count: 4
},
maxUses: 3,
sell: {
id: "rabbit_stew",
tag: {
display: {
Name: "Miles' Delicious Rabbit Stew",
Lore: [
"Works wonders!"
]
}
},
Count: 1
},
rewardExp: 0b
}
}
]
}
}```
Best Answer
There are many inconsistencies that are causing your command to fail. Here was your old data.
Problems
and the following is correct:
Enchantments
is in the wrong place. It should be outsidedisplay
but still insidetag
.Lore
tag should be a string tag containing raw JSON text, not compounds simulating JSON.\"
or you can use a full JSON component like in the images above.Just fix those 8 and you'll be good to go!