Question i'm trying to create config.yml to my plugin

  • After careful consideration and due to limited usage, we’ve made the decision to discontinue the PaperMC forums. Moving forward, we recommend using Hangar for plugin uploads, and for all other community discussions and support, please join us on Discord.

MkdirGit

New member
Jul 2, 2023
10
2
1
3
Israel
I had a bit of issue with trying to put my config.yml in the plugin folder,
wait, how to create for the plugin folder?
I would like to get basic help / template to look on.
 
Solution
Thanks for a quite response!
i found a way, just place in /resources
file called config.yml
and then add this piece of code:
Java:
        if (!getDataFolder().exists()){
            getDataFolder().mkdir();
            saveDefaultConfig();
        }

Explained
if The data folder of the plugin in /plugins folder not exists,
just create the folder { mkdir (-: }
and save the config from /resources at the folder.




MkdirGit

New member
Jul 2, 2023
10
2
1
3
Israel
Thanks for a quite response!
i found a way, just place in /resources
file called config.yml
and then add this piece of code:
Java:
        if (!getDataFolder().exists()){
            getDataFolder().mkdir();
            saveDefaultConfig();
        }

Explained
if The data folder of the plugin in /plugins folder not exists,
just create the folder { mkdir (-: }
and save the config from /resources at the folder.




 
Solution