Getting Config Keys

Discussion in 'Spigot Plugin Development' started by DrPlado, May 16, 2015.

  1. I am trying to get a list from the config of all of the keys. For instance
    Sam:
    Block:
    Armor:
    Bill:
    Block:
    Armor:
    Jeff:
    Block:
    Armor:
    I would only want to get Sam, Bill and Jeff's name, not their values(Blocks or Armor). What the final product will look like is I type in a command that creates an player, if I have two players (Bill, Sam) then it will store those names in an arraylist.
     
  2. ConfigurationSection#getKeys()
     
  3. @Skionz when I use getKeys method it takes a boolean which return a string.
     
  4. Why would you do it that way? Just make one config path and put all of those names in a list. Create a list and load that string list into it, and get what you want.
     
  5. But I need them to be a list of string not objects
     
  6. @Drtro Thats originally what I was going to do but the config is already being used, but I got this thanks guys for your help .