I currently have a custom config in my Mounts folder inside my plugins folder. I access it, through this method, but it always returns null. Code (Text): public static FileConfiguration getLanguageConfig() { File folder = new File(Core.getInstance().getDataFolder() + File.separator, "language.yml"); FileConfiguration fileConfiguration = YamlConfiguration.loadConfiguration(folder); return fileConfiguration; } I think I have the folder getter, set incorrectly, and if so, I'm not sure what to change it to.
Configs can never be null. It always creates a path. I think there's an exception to primitive types e.g checking for a boolean.
then that has nothing to do with config loading... null returns mean the value either isn't present or is manually set to null.
But it is present since it's all in the config. Code (Text): current-mounts-chest-name: MOUNTS rental-mounts-chest-name: &e&lRENTAL MOUNTS gui: mounts-item: "&e&lMounts" rent-mount-item: "&e&lRent-A-Mount" advertisement: "&4l&Advertisements and Sales" exit: "&4&lExit" mounts: chicken: Chicken cow: Cow pig: Pig sheep: Sheep zombie: Zombie creeper: Creeper spider: Spider skeleton: Skeleton enderman: Enderman
@BurnerDiamond File#getAbsolutePath(). That way you are 110% sure that if the file exists, you know that you are looking at the right file as well.