Help saving players data

Discussion in 'Plugin Development' started by OverDodo, Jun 22, 2017.

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

    OverDodo

    Hey,

    I am making a nickplugin and i have to save the players whole data (inventory, location, health, foodlevel etc) and return it to him after getting killed..
    How can i do that?
     
  2. @OverDodo
    Well, just get the data and store it some temporary object, and then return it to the player once they respawn?

    Something like this:
    Code:java
    1. private class PlayerData {
    2. Inventory inventory...
    3. Location location...
    4. double health...
    5. double food...
    6.  
    7. }
     
  3. Offline

    OverDodo


    Yea but how can i store all of this? or how can i make this compatible with a hashmap?
     
  4. @OverDodo
    Make a custom Object as I said, and then make a Map<UUID, PlayerData (or whatever you named the Object)>
     
  5. Offline

    OverDodo

    Thanks for your Help..
    I just stored the PlayerName with the CustomName method.. Ill make a new post, because i have a new question. <3
     
Thread Status:
Not open for further replies.

Share This Page