So here is my config: Code (Text): test: test1: 5 test2: 7 test3: 100 So under "test" there are 3 sections which are all Integer values. My question is how to cycle through under "test" and the names of the sections, i.e. test1 etc. I've tried this: Code (Text): for (String line : this.getConfig().getConfigurationSection("test").getKeys(false)) { System.out.println(line.toString()); } This actually prints out nothing and I've no idea why. Shouldn't it print out test1, test2 and test3?
Why do you do line.toString() ? line is already a string. Also the "line" is your key. Code (Text): for (String key : this.getConfig().getConfigurationSection("test").getKeys(false)) { System.out.println(this.getConfig().getInt("test." + key)); }
Then why doesn't mine work? The "key", or as I called "line", should print out to the console as "test1" etc. right?
Is the problem possibly that I have sections above it in the config? For example, my config could be: Code (Text): mobs: whatever: 5 players: even-more-whatever: 10 test: test1: 5 test2: 7 test3: 100 I don't think it is but want to cover all grounds here.
Have you made sure your config in the actual server has updated? Everything looks right and it should work