Hello everyone! I'm having a bit of trouble with my string lists. My current config is this, before attempting to create anything besides sections: Code: rohan576: points: {} purchased: player_upgrades: {} Then, once I attempt to add something to player_upgrades, this happens: Code: rohan576: points: {} purchased: player_upgrades: true Here's the code I use to attempt to add a string to the player_upgrades string list: Code:java yml.set(p + ".purchased." + upgradeSection, yml.getStringList(p + ".purchased." + upgradeSection).add(shopItem)); (p is the player's name, upgradeSection is "player_upgrades" [at the moment], and shopItem is "speed1" [once again, at the moment.]) Any help would be appreciated! Thanks! : )
rohan576 getStringList() returns an List<String>, and its add() method returns a boolean. Basically, you're setting the field "player_upgrades" equal to a boolean, not a List<String>. What you want to do is create a new List<String>, and set it equal to the string list in file. Code:java List<String> clone = yml.getStringList(p + ".purchased". + upgradeSection); Then add the object to that list Code:java clone.add(shopItem); Then update the file by setting the field equal to the clone list. Code:java yml.set(p + ".purchased." + upgradeSection, clone); Then save the file.