Solved Replacing Values in the config.yml

Discussion in 'Spigot Plugin Development' started by MaxKrissigo, May 29, 2016.

  1. I'm trying to replace a value in my config.yml. How would I go about replace the REC with something else? Here is what my config.yml looks like:
    Code (Text):
    Ranks:
      2a1599da-2b4c-4328-9a33-5cc62e7d031b: REC
    I'm tried doing this, but tit just add that same thing again with my new value:
    Code (Text):
     getConfig().set("Rank." + uuid, "PVT");
     saveConfig();
    Code (Text):
    Ranks:
      2a1599da-2b4c-4328-9a33-5cc62e7d031b: REC
    Rank:
      2a1599da-2b4c-4328-9a33-5cc62e7d031b: PVT
     
     
  2. Its generating a new line because "Rank" doesn't exists it needs to be "Ranks"
     
    • Like Like x 1
    • Agree Agree x 1
  3. I really need to look through my code more carefully xD Thanks for pointing that out!
     
  4. Haha no problem everyone could make that mistake