Yaml Not Updating!

Discussion in 'Plugin Development' started by chasertw123, May 10, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    chasertw123

    Hello I am making a kit plugin but I having a problem were when a player buys a kit and they have the proper amount of money they get sent the message and sound but the yaml doesn't remove there coins and add the string to the string list.

    Here is the code:
    Code:java
    1. else {
    2. yaml.set("Stats.Coins", yaml.getInteger("Stats.Coins") - kit.getPrice());
    3.  
    4. List<String> list = new ArrayList<String>();
    5.  
    6. list.addAll(yaml.getStringList("Bought_Kits"));
    7. list.add(kit.getName());
    8.  
    9. yaml.set("Bought_Kits", list);
    10.  
    11. plugin.sendMessage(p, ChatColor.GREEN + "You bought the "
    12. + ChatColor.GOLD + kit.getName() + ChatColor.GREEN + " kit!"); // This message gets sent
    13. p.playSound(p.getLocation(), Sound.LEVEL_UP, 1, 1);
    14. p.closeInventory();
    15. return;
    16. }
     
  2. Offline

    xXSniperzzXx_SD

    chasertw123
    Are you saving the config after editing it?
     
    chasertw123 likes this.
  3. Offline

    chasertw123

Thread Status:
Not open for further replies.

Share This Page