Solved How can I save player data

Discussion in 'Plugin Development' started by Pacothegint, Dec 8, 2014.

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

    Pacothegint

    I need to have access to all players that have logged on.

    I have not had to store player data yet and have looked at many different tutorials and none of them did what I wanted to do.

    So what I want to do is when a player joins I want to get their name and UUID into a yml file
    Such as
    UUID
    -name

    How can I do that?
     
  2. Offline

    Skionz

    Pacothegint Use the FileConfiguration API. Read through the Javadocs.
     
  3. Offline

    HeadGam3z

    Use an event called PlayerJoinEvent.
    Get the player and their UUID.
    Create a yaml file with their UUID as the name (or whatever you want).
    Check to see if there is a file with their UUID [as the name] in your plugin's data folder.
    If false, create a new yaml file - do whatever.
    If true, do whatever (loadConfiguration, add one to one, shutdown(), etc).
     
  4. Offline

    moo3oo3oo3

    Hashmaps, props file, txt files, props file, database, yaml file, ect.
     
  5. Offline

    HeadGam3z

    e_e
     
  6. Offline

    moo3oo3oo3

    didn't see that :p
     
    HeadGam3z likes this.
Thread Status:
Not open for further replies.

Share This Page