Create a custom config without code?

Discussion in 'Spigot Plugin Development' started by kinukin, Jun 4, 2017.

  1. How can I create a custom config in a folder? For example: Creating a .yml file into the folder will automatically create a custom config file

    I want to be able to create custom configs into a folder without creating it from code. Is it possible?
     
  2. Gianluca

    Gianluca Retired Resource Staff
    Retired Patron

    You can always right click, create new file, and save it as YAML? I don't fully understand what you mean. You will need code to load it into memory however
     
  3. Yes that's what I mean.

    How would I set default values to it, so I can write in it?

    For e.g (inside the config) :
    Name: this is editable
    ItemStack: this is editable


    Could I just check the directory folder for all files ending with .yml and put default values in it?

    So Step 1: Right click, create new file and save it as YAML
    Step 2: Write Name: and ItemStack:
    Step 3: then write values into name and itemstack
    Step 4: then load the values

    Is this possible?