Read data from a .yml file?

Discussion in 'Plugin Development' started by olsyboy, Aug 5, 2015.

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

    olsyboy

    I need to:

    Set data on command to a .yml file, specific line etc.
    Read from that file, specific line etc.
    Put that data into a variable, and split it into x y z coordinates.


    How should I accomplish this?
    Thanks for any help. I am working on a spleef plugin.
     
  2. Offline

    Gater12

    Shortninja66 likes this.
  3. Offline

    pie_flavor

    @olsyboy If you are asking how to do it with one that isn't config.yml, that's not actually listed but still pretty easy. To get a file, do YamlConfiguration.loadConfiguration(File). Then to save it, use FileConfiguration#save(File). If the file doesn't exist when the first method is called, it returns a blank FileConfiguration.
     
  4. Offline

    olsyboy

    Thank you.
    No, I am not familiar with that API
     
Thread Status:
Not open for further replies.

Share This Page