Posted May 18, 201510 yr I have hit a minor roadblock in my mod. I'm usually pretty good with using Gson but I'm having problems. I would like to know how to have names and values as a value for a name. This probably sounds REALLY confusing so I'll explain. I want to something similar to minecrafts mcmeta files. In some, there is an animation: { "animation":{} } And some blocks/items have values inside that animation: { "animation": { "frames": [ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 ] } } That is what I want to do. If you aren't really confused by this, how would I do that? If you are confused, tell me, I might be able to explain this better.
May 18, 201510 yr Ok, I think that answers my question. So if I'm understanding this correctly, I would do something like this? JsonWriter json = new JsonWriter(new FileWriter(file)); json.beginObject(); json.name("example"); json.beginObject(); json.name("exampleString").value("value"); json.endObject(); json.endObject(); json.close();
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.