Using .yml files

Discussion in 'Plugin Development' started by kabbage, Mar 27, 2012.

  1. Offline

    kabbage

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    If I had a .yml file that looked like this:
    Code:
    users:
      kabbage:
        num: 17
    How would I load the file and get the number 17, and then how would I change that number to something else? (like 18)
  2. Offline

    Tzeentchful

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    if you have any more questions to do with configs go to the wiki.

    Code:
    int num = getConfig().getInt("users.kabbage.num");
     
    getConfig().set("users.kabbage.num", 666);

    This post has been edited 3 times. It was last edited by Tzeentchful Mar 27, 2012.
  3. Offline

    kabbage

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    I don't mean the config.yml file, I need to edit a different file that also has the extension of .yml.
  4. Offline

    Lolmewn BukkitDev Staff

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    YamlConfiguration config = YamlConfiguration.loadConfiguration(someFile);

Share This Page