YAML Iteration

Discussion in 'Plugin Development' started by Nogtail, Jul 17, 2013.

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

    Nogtail

    I want to save a list of entities UUIDs in a YAML file along with corresponding data about the entity but I'm not sure how to iterate through it (or what data type to use).

    What the yml file would look like:

    Code:
    UUID1:
      data1: 10
      data2: 15
    UUID2:
      data1: 100
      data2: 150

    I just need a way to example use a for loop to go through the UUIDs so then I can read the data1/data2 from them.
    Thanks :)
     
  2. Offline

    amitlin14

    for(String key : config.getConfigurationSection("watever contains the UUID's").getKeys(false)) {
    Bukkit.broadcastMessage(key + ".data1");
    Bukkit.broadcastMessage(key + ".data2");
    }
     
    Nogtail likes this.
Thread Status:
Not open for further replies.

Share This Page