Solved How to save player names in a list?

Discussion in 'Spigot Plugin Development' started by ShishKaBobz, May 7, 2017.

Thread Status:
Not open for further replies.
  1. Hello, I'm having problems with my list's so, if i use plugin.getConfig().getList("List").add(player.getName());
    .add is underlined red, So how can I do this?? plugin.getConfig().getStringList("Prefix").set(0,player.getName()); works But it would set the first number every time.. Thanks in advance!
     
  2. i would always first initialize your requested list from the config like so, and then add your values:

    Code (Text):

    List<String> listFromConfig = plugin.getConfig().getStringList("Path");
    listFromConfig.add(yourValue);
     
     
  3. Hey Thank you!
     
Thread Status:
Not open for further replies.