#Need help with saving data to Json
22 messages · Page 1 of 1 (latest)
Paste version of spawn_con.js from @urban escarp
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
Here's a simple snippet showing how to use JsonIO to read/write JSON files anywhere within the Minecraft folder:
// Reading the contents of the file from the given path
config = JsonIO.read('kubejs/config/myawesomeconfig.json')
// Writing to an existing/new file
JsonIO.write('kubejs/config/myawesomeconfig.json', {settinga: 'creeper', weirdblock: 'minecraft:end_gateway'})
thats for writing the json
to convert to string, is there no toString()?
you can also try .getString() if i remember correctly (some classes use that instead)
i tried that and it didn't work
the tostring?
both
what error did you get
tostring and getstring
no method found in object Object
which is weird cus it's nativeobject
hm
well doesn't matter cus the write read the native object fine
thanks for the help :D
Ticket closed!
