Setting something in config

Discussion in 'Spigot Plugin Development' started by _Wiildanimal_, May 17, 2016.

  1. I have a problem, I want to set one of my sections in the config to "requests: []" like a closed string list.

    I have the following code:
    Code (Text):
    String brackets = "[]";
                       
                        getFriends().set(stringID+".requests", brackets);
                        getFriends().set(stringID+".friends", brackets);
                        saveFriends();
    However, in the yml it ends up being "requests: '[]'" with a quotation mark. How can I solve this?
     
  2. You would need to have the quotes around it, as it is a string. You would then manually parse it.

    Alternatively you can use a String List which will use hyphens on new lines to indicate different strings.
     
    • Informative Informative x 1