addJson does not work in 1.18.2
ChiefArug opened this issue ยท 3 comments
Minecraft Version
1.18.2
KubeJS Version
kubejs-forge-1802.5.1-build.353
Rhino Version
rhino-forge-1801.1.9-build.135
Architectury Version
architectury-4.2.50
Forge/Fabric Version
40.1.0
Describe your issue
Tested by adding a tag to red or black wool. Neither work, but the message does get logged.
onEvent('server.datapack.last', event => {
console.log('datapack last event triggered')
event.addJson('minecraft:tags/blocks/floofs', {
"replace": false,
"values": [
"minecraft:black_wool"
]
})
})
onEvent('server.datapack.high_priority', event => {
console.log('datapack high priority event triggered')
event.addJson('minecraft:tags/blocks/floofiest', {
"replace": false,
"values": [
"minecraft:red_wool"
]
})
})
Also tried with some worldgen data while testing for #325. Didnt work.
Crash report/logs
No response
Same as #309
Alright, so in short, there was an issue here, which is that KubeJS virtual datapacks couldn't add JSONs to new namespaces (i.e. ones that don't have any data attached already).
However, the code you posted wouldn't do what you want it to do anyways because you forgot the .json
at the end of the filename, meaning it would've been added to the datapack as a file without an extension :p
I've "fixed" both of these indev, the first using a horrible, horrible workaround, the other one by just appending .json
if the user forgets to do that