How to save a yml thats included in the jar?

Discussion in 'Plugin Development' started by TigerHix, Dec 17, 2013.

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

    TigerHix

    Well this question should be simple, but I couldn't seem like to find it on the forum.

    Let's say I exported the jar with config.yml and another custom yml, say book.yml. How could I save this file if it doesn't exist in the plugin folder, like what saveDefaultConfig() does? And what should be the steps to read/save this custom yml file?

    Thanks in advance.
     
  2. Offline

    The_Doctor_123

    You need to create it in the main directory of your project, then select it when exporting.
     
  3. Offline

    1Rogue

    Code:java
    1. plugin.saveResource("yourFile.yml", true);
     
  4. Offline

    TigerHix

    The_Doctor_123

    o_0 that means if u export it into a jar, it will be automatically generated in the plugin folder?
     
  5. Offline

    1Rogue


    No, it will not. You need to save the resource yourself.
     
Thread Status:
Not open for further replies.

Share This Page