YML File Reading sub-values

Discussion in 'Plugin Development' started by MasterDoctor, Apr 11, 2016.

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

    MasterDoctor

    My plugin generates random codes and then logs one with a player in a file (data.yml). I want to check if each code is unique to each player and if not, generate another.
    This is my YML file layout:
    Code:
    player:
      {uuid}:
        code: 85HJF85JG
      {uuid}:
        code: 785FMG83
    is there a way that I can iterate through the code value for each UUID in the config and see if the code I have matches the other one.
     
  2. Offline

    Lordloss

    as i remember the Config class has a method "getKeys" or something like that, which gives you a collection of all the entries.
     
  3. Offline

    MasterDoctor

    I remembered that too but I wasn't sure of how I could use it - I'll have a go with it
     
Thread Status:
Not open for further replies.

Share This Page