Solved Loop every UUID in config

Discussion in 'Spigot Plugin Development' started by C4LLM3P3T3R, Feb 12, 2020.

  1. Hello,
    I need to loop through every uuid in config
    The config looks like this

    Code (Text):
        (Some uuid)
            Reason: 'reason'
            Time: 60
    I need to get that uuid to run a bukkit runnable that substracts 20 from time
    Any help?

    for(UUID uuid : getConfig())????
  2. I think you want to use

    for(UUID uuid : getConfig().getConfigurableSection("bans").getKeys(false)) {
    String path = "bans." + uuid + "." + <whatever you're trying to get>;
    // yada yada yada

    Don't have an IDE with atm sorry.
  3. Bruuuuh i was reading the config documentation again and found this. I'll try it, thanks for the reply. I hope it works
  4. Works!! Thank you!