[YAML] Deleting a section

Discussion in 'Plugin Development' started by Deleted user, Feb 17, 2013.

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

    Deleted user

    How can I delete a section and not just set it to null, which results in something like this:

    Code:
    arena: []
    
    Code:
    YamlConfiguration f = YamlConfiguration.loadConfiguration(arenaFile);
    ConfigurationSection section = f.getConfigurationSection("arenas." + arenaName);
     
    section.set(arenaName, null);
     
    
     
  2. You set the path to null instead.

    f.set("arenas", null);
     
  3. Offline

    Deleted user

    Because that would set all the sections (other arenas) to null as well.
     
  4. Offline

    Sagacious_Zed Bukkit Docs

    Then set whatever arena you want to delete to null...
    But you actually have the yaml for an empty list.
     
Thread Status:
Not open for further replies.

Share This Page