I was wondering if there was a way or some method to return a list of all the sub-paths of a particular path in a config. Code (Text): numbers: one: 1 two: 2 three: 3 In a config such as the one shown above, how would I get a list containing "one", "two", and "three" as sub-paths of the path "numbers"?
Code (Text): String one = getConfig().getString("numbers.one"); String two = getConfig().getString("numbers.two"); String three = getConfig().getString("numbers.three"); Put these in the main frame of code do you can refer to these in any of your code.
@Exus-Kun That was an example config file. I want a method that returns the sub-paths based on the config, not on set code such as yours because if the user were to change the config sub-paths to something else, I would then get errors. I want something that actually reads the path and returns the sub-paths.
Nevermind, I found a solution using FileConfiguration.getKeys() For future reference, you can see here: https://hub.spigotmc.org/javadocs/s...iguration/MemorySection.html#getKeys(boolean) https://bukkit.org/threads/fileconfiguration-get-a-list-of-main-paths.162175/