[bug] Required to wrap attributes in escaped stringified json?
Greg-J opened this issue ยท 1 comments
Fabric 1.18.1
This may be intended, but I find it strange. If I attempt to use the following recipe, the recipe fails to load:
{
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"item": "minecraft:paper"
},
{
"item": "minecraft:gunpowder"
},
{
"item": "minecraft:gunpowder"
},
{
"item": "minecraft:gunpowder"
},
{
"item": "minecraft:gunpowder"
},
{
"item": "minecraft:gunpowder"
},
{
"item": "minecraft:gunpowder"
},
{
"item": "minecraft:gunpowder"
},
{
"item": "minecraft:gunpowder"
}
],
"result": {
"item": "minecraft:firework_rocket",
"count": 3,
"data": {
"Fireworks": {
"Flight": 127
},
"display": {
"Name": [
{
"text": "Strength X",
"italic": false
}
]
}
}
}
}
However, the following recipe loads just fine:
{
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"item": "minecraft:paper"
},
{
"item": "minecraft:gunpowder"
},
{
"item": "minecraft:gunpowder"
},
{
"item": "minecraft:gunpowder"
},
{
"item": "minecraft:gunpowder"
},
{
"item": "minecraft:gunpowder"
},
{
"item": "minecraft:gunpowder"
},
{
"item": "minecraft:gunpowder"
},
{
"item": "minecraft:gunpowder"
}
],
"result": {
"item": "minecraft:firework_rocket",
"count": 3,
"data": {
"Fireworks": {
"Flight": 127
},
"display": {
"Name": "[{\"text\":\"Strength X\",\"italic\":false}]"
}
}
}
}
This is confusing to me.
Well, you always need to stringify the JSON of text components, that's what the vanilla game wants.
It would be out of scope for Nbt Crafting to change that directly.
Nbt Crafting does provide some sugar to that stringification though, to make it easier to work with (see the wiki):
{
...
"result": {
"item": "minecraft:firework_rocket",
"count": 3,
"data": {
"Fireworks": {
"Flight": 127
},
"display": {
"Name": [
{
"text" :"Strength X",
"italic": false
},
"nbtcrafting:stringify"
]
}
}
}
}