Reading/Writing data to a JSON file

Discussion in 'Plugin Development' started by Unempl0yedNinja, Jun 20, 2015.

Thread Status:
Not open for further replies.
  1. Hey, I'm trying to lookup how to use JSON files and i can't seem to find any relevant content in my searches. If anyone could link me to some stuff I can look at, that would be great, thanks.
     
  2. Offline

    xXkguyXx

    Why ? Just Use config.yml files, there Simpler
     
  3. yea but json is more complex lol
     
  4. Offline

    teej107

    @Unempl0yedNinja json-simple is a good library to read and write JSON and save them to files. It is already packaged with the Bukkit API.
     
  5. Offline

    RingOfStorms

    You just have to read and write the string to and from a file, the fact that it is json doesn't change much to how it acts with a file. Just look up any java tutorial on how to write/read text to/from a file.
     
  6. @RingOfStorms Yes but using the json format means I can easily handle the data on a web based platform too
     
  7. Offline

    RingOfStorms

    Yes json is very easy to use cross platform! Still doesn't change the fact that to save it to a file it is simply the act of writing and reading text from a file.
     
  8. @RingOfStorms Yea but why right my own code to write to a text file when I can use other library's to do it for me? I'm a bit lazy :p
     
  9. Offline

    mythbusterma

    @Unempl0yedNinja
    It helps if you actually read what people write.
     
    teej107 likes this.
  10. I did read it, and I have decided to use YML for now, although I did actually start to read into json-simple a bit...
     
Thread Status:
Not open for further replies.

Share This Page