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

    johnny boy

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

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

    Nostos

    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

    johnny boy

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

    Lorinthio

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

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

    johnny boy

    yea thanks realised I was using the wrong thing.

    Sovled.
     
Thread Status:
Not open for further replies.

Share This Page