Write comments like essentials?

Discussion in 'Plugin Development' started by Trevor1134, Apr 17, 2014.

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

    Trevor1134

    Essentials has a config.yml file with comments that are consistent after reload. How do I do the same thing on my own plugin?
     
  2. Offline

    MrInspector

    Well there is probably a different way to do this, but instead of saveConfig() use saveDefaultConfig().

    (If I understand you correctly, that is.)
     
  3. Offline

    Minnymin3

    You have to put a space after the #
     
  4. Offline

    Trevor1134

    Minnymin3 MrInspector I want to write it via code, not make a config.yml file and add it to the project.
     
  5. Offline

    nlthijs48

    Trevor1134 I don't think that is possible, by code you can only add a comment block at the top and not for each individual config line. For my own plugin I add the config.yml to the project (and .jar file) and use the .saveDefaultConfig() in the onEnable() method. That way I can add comments to each line and explain what it does.
     
  6. Essentials has it's own way to handle the config/whc-ich doesn't filter out the comments.
     
  7. Offline

    Minnymin3

Thread Status:
Not open for further replies.

Share This Page