Hashmaps Or Config File?

Discussion in 'Plugin Development' started by DutchChris, Aug 13, 2020.

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



    Was wondering what the best way was to store data in a plugin. For example, if I wanted to store a "double balance" variable for each individual player, what would the best way to store this be? And how would I then make the above work? Thanks in advance!
  2. Online

    timtower Moderator Moderator

    @DutchChris You need a config for that, otherwise it resets every time.
    And a Hashmap<uuid, double> will do the trick.
  3. Offline


    Could you possibly explain how config files work? Just briefly. I understand how hashmaps work but I am not familiar with config files like at all. Thanks for the reply anyway
  4. Online


  5. Offline


    @DutchChris the way you word it, it sounds like comparing apples and oranges.

    Config files are persistent, HashMaps are not. A HashMap is stored in memory, meaning in RAM at runtime, and will be lost when the program terminates. Config files are stored in physical memory.

    So the question should be, do you want the data to persist or not.
Thread Status:
Not open for further replies.

Share This Page