Solved Getting any value from another file other than the config.yml

Discussion in 'Spigot Plugin Development' started by Wilsoon, Feb 14, 2020.

  1. I'm making more redundant posts...
    But, what do I need to make another file and get any details from it other than the config.yml?
  2. Code (Text):
    private File data;
    private FileConfiguration datacfg;

    public void createData() {
            data = new File(getDataFolder(),"data.yml");
            if(!data.exists()) {
            datacfg = new YamlConfiguration();
            try {
            }catch (IOException | InvalidConfigurationException e) {
        public void saveData() throws IOException{
        public FileConfiguration getData() {
            return this.datacfg;
    Also as config.yml a file named data.yml must be created

    Requires you the ability to actually get the plugin instance known(aka knowing how to create/get instances)
    #2 Stellrow, Feb 14, 2020
    Last edited: Feb 14, 2020
    • Like Like x 1
  3. Thanks for the quick reply!