Solved getStringList().add() is just returning true

Discussion in 'Plugin Development' started by johnny_boy, Feb 9, 2018.

Thread Status:
Not open for further replies.
  1. Offline


    plugin.getConfig().set("test", plugin.getConfig().getStringList("test").add("John"));

    Just returns true and not John..
    Last edited: Feb 9, 2018
  2. Offline


    well I don't use configs much but... why are you using net.minecraft.server for material instead of the regular bukkit one? what i'm saying is replace
    import net.minecraft.server.v1_8_R1.Material;
    with import org.bukkit.Material; this could be your problem but i don't think so...
  3. Offline


    It does say that add() is a boolean.. so what would I use if it isn't add()?
    Last edited: Feb 9, 2018
  4. Offline


    I don't understand what you are trying to accomplish. If you are trying to add "John" to a list in the config...

    FileConfiguration config = plugin.getConfig();
    String[] list = config.getStringList("test");
    config.set("test", list);
  5. Offline


    yea thanks realised I was using the wrong thing.

Thread Status:
Not open for further replies.

Share This Page