Calling Config from separate Command Executor File

Discussion in 'Plugin Development' started by Begreen98, Mar 18, 2013.

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

    Begreen98

    I have my config getting set up and everything works when the command is in the same Class as the class setting up the Config, but when I try to call it from a different Command Executor class it doesn't find it. How do I make it so I can call it?
     
  2. Offline

    chasechocolate

    How are you accessing it? From an variable instance, or a static variable, etc.? It may not work because the file does not exist. Do you get any errors?
     
  3. Offline

    Begreen98

    The code setting up the Config is
    Code:
    public void setupConfig(FileConfiguration config) throws IOException {
            if (!new File(getDataFolder(), "RESET.FILE").exists()) {
     
                config.set("Odsarh.Name", "Odsarh");
                config.set("Odsarh.Age", "Unknown");
                config.set(
                        "Odsarh.Bio",
                        "The eldest man known. He is the Arch Mage of the High Consoul. He is responsible for controling the balence of evil and good. He also decides on who will be though the art of Magic");
                config.set("Odsarh.Race", "Human");
                new File(getDataFolder(), "RESET.FILE").createNewFile();
    And the code trying to access it is
    Code:
    getConfig().set(sender.getName() + ".Age", args[0]);
     
Thread Status:
Not open for further replies.

Share This Page