Setting Comments in Configuration

Discussion in 'Plugin Development' started by Acer_Mortem, Apr 18, 2014.

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

    Acer_Mortem

    I keep seeing comments in configuration files, and I was wondering how to create them. Something that would look like this:

    #Hello! This is the Config!
     
  2. Offline

    Zix

    Thats exactly how you do it. Just put a hashtag in front of what you want to comment
    Code:
    # This is my Config File!
    message: hello!
    <other config stuff here>
     
  3. Offline

    Heirteir

    Acer_Mortem
    Well another way you could do it so that way it will save to other config files is
    Code:java
    1. getConfig().options.header("Comment Text");
    2. getConfig().set("heirteir.is.awesome", true);
    3. getConfig().options.header("You know it!");
    4. saveConfig();


    This will make a Comment above my string that says "Comment Text" then under that will be my boolean then it will create a comment after my Yaml declaration saying "You know it!". I hope this is what you were looking for.

    --Heirteir
     
Thread Status:
Not open for further replies.

Share This Page