Solved Config help

Discussion in 'Plugin Development' started by justin_393, Jun 26, 2015.

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

    justin_393

    Hey,

    So basically I'm trying to make something that when a player joins it will add them in a config like this.

    Code:
    players:
      players-uuid:
        name:
        other-info-i-want:
    But I can't figure out how to add stuff to the players:

    Anyone have any ideas?
     
  2. Offline

    bobacadodl

    And to check if they are already in config, do something like check if config.hasConfigurationSection("players."+p.getUniqueId().toString()) is true
     
  3. Offline

    justin_393

    Yeah, I tried that already, but it didn't work.

    here was where I did it:

    config.set("players." + p.getUniqueId().toString() + ".name", p.getName());
     
  4. Offline

    bobacadodl

    What didn't work about it?
     
  5. Offline

    justin_393

    It simply didn't work. I opened my config and the section "players:" wasn't even there, but it's in the default config inside of my plugin
     
  6. Offline

    bobacadodl

    Um.. did you remember to save the config after that?
     
    KingFaris11 likes this.
  7. Offline

    justin_393

    right... good call.

    lemme try that real quick

    @bobacadodl
    Yep, that was the issue, my bad :p

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 12, 2016
Thread Status:
Not open for further replies.

Share This Page