Best way of storing player attributes?

Discussion in 'Plugin Development' started by CompuIves, Jun 3, 2012.

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

    CompuIves

    Hey guys!
    I'm looking for a way in general to store several player attributes, like if you're making an RPG plugin, you'll need to store the levels etc.
    What's the best way of doing this?
    Thanks in advance!
     
  2. I belive: HashMap<String, CustomClass> where String is player's name and CustomClass holds those atributes.

    EDIT: oh, if you meant store them on the hard drive, then the *best* way would be a database... but I belive you can use a flatflie style too... yml would be good too but not so much.
    You could just save the hashmap to file and then easily load it as well, there are examples in the plugin tutorial: http://wiki.bukkit.org/Plugin_Tutorial#Saving.2FLoading_a_HashMap
     
  3. Offline

    CompuIves

    Thanks! That's exactly what I needed!
     
Thread Status:
Not open for further replies.

Share This Page