Hi, Its me again (sorry, I know I'm kind of nooby).
I was wondering if anybody could tell me the best way to store data in minecraft? My current project is a warp mod and I would like to store the data for some warps. For example, I want to say /setwarp <warpname> and have it set the x,y,z locations of where your standing into some sort of storage. Then when you do /warp <warpname> it will warp you to the coordinates stored. I dont want the warps to be player spceific, but I WOULD like them to stay the same from one instance of the game to the next. I would like to avoid using SQL or something similar. I will tackle SQL later when I start experimenting with servers. I am sorry if this question makes no sense. Thanks.
You can have more control over how/when/on what side to save data. And in my case I am saving user created javaScript programs so if the player looses the access to the program ingame he can still copy it from the txt(or what ever extension) file.
Hi, Its me again (sorry, I know I'm kind of nooby).
I was wondering if anybody could tell me the best way to store data in minecraft? My current project is a warp mod and I would like to store the data for some warps. For example, I want to say /setwarp <warpname> and have it set the x,y,z locations of where your standing into some sort of storage. Then when you do /warp <warpname> it will warp you to the coordinates stored. I dont want the warps to be player spceific, but I WOULD like them to stay the same from one instance of the game to the next. I would like to avoid using SQL or something similar. I will tackle SQL later when I start experimenting with servers. I am sorry if this question makes no sense. Thanks.
You shouldn't need SQL for this. In fact, you could use just a simple text file, store the information using a system similar to this:
As you're only going to access that file on load and when adding new warps, performance shouldn't be an issue.
Check out my mod, Placeable Items!
If my comment helped you or you just like me, hit the green arrow down there!
I know it says resolved, but their are two built in methods. NBTTags for items and tileentities and WorldSaveData. There is also player data.
Edit:
I'm using 1.7.10. Not sure if they changed in 1.8
My Mods:
- Happy Coding -
You can build a custom file reader/writer like me
https://github.com/LapisSea/Magiology_1.8/blob/master/src/main/java/com/magiology/io/WorldData.java
Not doing mc modding that much anymore because I am making a full blown game that does not have limitations that mc has. (rip Magiology for now)
I may come back if MC fixes it's rendering pipeline.
Why use a custom one and not the built in one?
My Mods:
- Happy Coding -
You can have more control over how/when/on what side to save data. And in my case I am saving user created javaScript programs so if the player looses the access to the program ingame he can still copy it from the txt(or what ever extension) file.
Not doing mc modding that much anymore because I am making a full blown game that does not have limitations that mc has. (rip Magiology for now)
I may come back if MC fixes it's rendering pipeline.
Awesome thanks for all the input everybody! This community is awesome. Upvotes everywhere