Solved Getting string from file

Discussion in 'Spigot Plugin Development' started by Kryptonix2Shot, Nov 20, 2019.

Thread Status:
Not open for further replies.
  1. I'm trying to make a command that reloads the config files, but right now I'm having trouble getting it to even send a message to the player. I'm setting it up so all of the messages in the plugin are customizable in a custom config file.

    I have a config manager class that creates the config files and heres the link to the code for it. https://pastebin.com/VGpdPzad


    And heres a link to the command class ConfigReload where I'm having trouble pulling a string from a custom file as a message. https://pastebin.com/jw6TUvpe
    I'm trying to get it so on sender.sendMessage(cfm.getMessagesCfg.getString("reload")); that it pulls the custom message I have setup in the messages.yml file.

    Also heres a link to my main class if needed: https://pastebin.com/qsJNRBk4
     
  2. Post your config files please
     
  3. u can use
    Code (Java):
    [File].createNewFile();
     
  4. The messages field is null because it doesn’t get initialized in your command class.

    I would create a constructer that initializes it
     
  5. Creating the constructor worked, thanks!
     
Thread Status:
Not open for further replies.