Config substituting values

Discussion in 'Spigot Plugin Development' started by Cuthmf, May 21, 2017.

  1. How do I add a value in the config?

    Because the method I'm using is under-replacing

    Code:
    Code (Text):
    public void saveQuestion(String player, String message){
            YamlConfiguration c = new YamlConfiguration();
            c.set("Books."+Integer.toString(MakeForm.getQuestionNumber(player)), message);
            try {
                c.save(new File(this.plugin.getDataFolder() + File.separator + "books", player + ".yml"));
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    Config:

    Books:
    '9': 'Lool'