Solved Save & load player data

Discussion in 'Plugin Development' started by re4ly, Oct 8, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    re4ly

    hey, bukkit!
    I want save and load many information about a player (inventory, armor, xp, location, hungerbar). What is the smartest and easiest way to do this?
     
  2. Well, every method has it's pros and cons and should be picked depending on your situation. Files are easy to manage but will get out of control when you have large amounts of them, but you have a very short access time if you store things in memory otherwise loading and saving will take a long time. A database on the other side is overkill for small amounts of data, but can handle huge amounts of data very easy. However, it might also be harder to use, when you're new to it.
     
  3. Offline

    remremrem

    If you need to save and load this information many times per hour, I would use a database.
    If you only need to access this information when the player logs on and disconnects, I would store each player's information in their own playername.yml file.
     
  4. Offline

    Jnorr44

    Tehmaker likes this.
  5. Offline

    re4ly

    A big thank you to all!
     
  6. Offline

    Ultimate_n00b

    Doesn't do armor ;)
     
  7. Offline

    Jnorr44

    I believe armor holds a place in inventory slots.

    Oh whoops I didn't update away the savedversion parameter in one of the constructors, just replace that with a Map<String, Object>.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 4, 2016
  8. Offline

    Ultimate_n00b

    It does not.
     
  9. Offline

    Jnorr44

    Alright, well, it doesn't seem to be a problem for him. I will fix it in my version.
     
Thread Status:
Not open for further replies.

Share This Page