Pathes...
Kisuny opened this issue ยท 16 comments
well... Hello again... I want to replace recipes in stages, but I absolutely can't understand how it works.. I do everything on the wiki, but I catch constant errors, such as:

in the script, everything looks like this, here is the remove operator, because it is easier to work with it.

I tried different variations, but everything leads to this error in the log..
Arrays are zero-indexed, meaning that the first index is 0 and the last will be (size - 1). I think the First Steps research has 3 recipes, so removing the last one should use index 2. I do have to say though that I really should have a better (more user-friendly) error message for that.
You might be able to do something like this:
[
{
"key": "FIRSTSTEPS",
"ops": [
{
"op": "remove",
"path": "stages/2/recipes"
},
{
"op": "add",
"path": "stages/2/recipes",
"value": []
}
]
}
]
Your recipes would go in the value of the add operation (or you can add them later). This is untested so there might be syntax errors but that's the general idea.
instead of "minecraft:chest" put:
[
"minecraft:chest"
]
(Notice that it's an array, even though it only has a single element)
That one might be a bug, I have to check the json patch spec to see if what I suggested is allowed and if so why its breaking. In the meantime, the following should work:
[
{
"key": "FIRSTSTEPS",
"ops": [
{
"op": "remove",
"path": "stages/2/recipes"
},
{
"op": "add",
"path": "stages/2/recipes",
"value": []
},
{
"op": "add",
"path": "stages/2/recipes/-",
"value": "minecraft:chest"
}
]
}
]
Last suggestion I have is to try removing / fixing that invalid entry the log is complaining about, other than that I have to check later for a possible bug
Oh that first 3 should also be a 2 for the same reason, sorry for not noticing that! So this should work: stages/2/recipes/2
So this is a bit odd but this works for me:
{
"key": "FIRSTSTEPS",
"ops": [
{
"op": "remove",
"path": "stages/2/recipes"
},
{
"op": "add",
"path": "stages/2/recipes",
"value": ["minecraft:chest"]
}
]
}
Did you edit the chest recipe in CraftTweaker or something? The only thing I can think of is that the chest recipe is not found...

















