Hey! If I have this path in my config: Code: Test: test1: Members: - testmember1 test2: Members: - testmember2 How would I get the path (the test1.blabla path)? I want to do a command where you invite people to join the "test1", but to get what "test group" they are in, I need to get the path. It's hard to explain. I want to get what is in red when you do a command: Test: test1: Members: - testmember
adde Assuming you want to check what list contains a player, you'd need to set up a for loop for the ConfigurationSections, and getting the "Members" list, for each of them.
How would I do this? I want to get the path to the where it says test1. Like, the path to it is "Test.test1" but how would I get it when they do a command? Check through the whole config, get the player name, remove the members tab? Done? Edit: Never mind, I used getKeys(boolean).
Okay, I managed to do it yesterday.. And then suddenly today when testing the code, getKeys only gets the first section below "Test"? Anyone?
adde for every key in the section "Test", use getKeys(boolean) again, so for example, now on "test1". Then you get keys in the "test1" section (In your case, this will return "Members").
Already tested. What do you mean? If I do getConfig().getGetConfigureSection("Test").getKeys(false) in a for String loop it will still give me only the first after Test. So if I have like test2 and test3 they won't print out.
Well, I don't really know how to explain this... xD I am trying to say, that if you do getKeys(boolean) on "test1", it will return "members";
I know, but I need to check the whole "Test" (the main node) Code: Node: test1: Members: - testuser1 Home: X: 135.97026507341664 Y: 80.0 Z: -63.72998146720581 Set: false test2: Members: - testuser2 Home: X: 135.97026507341664 Y: 80.0 Z: -63.72998146720581 Set: false This is an example. If I do /testcommand I want it to print in the console with System.out.println(key); The code looks like: Code:java for(String key : getConfig().getConfigurationSection("Node").getKeys(false)){ System.out.println(key);} It should print BOTH test1 AND test2. Now it only prints test1. If I do Code: System.out.println(getConfig().getStringList("Node." + key + ".Members"); it will only print the test1 member list. Hope you understand what I am trying to do. I need it to check BOTH.