How can i set a config value with the key having ' in it. Here is a example, I have it checking if the player is in the config then if not set it: Code:java if (!getConfig().isSet("Players." + player.getName())){upd("Players." + player.getName() + ".on", true); my upd method: Code:java public void upd(String loc, Object value) {getConfig().set(loc, value);saveConfig();} Here is my config that it sets Code: Players: xXFuZioN360Xx: 'on': false but i dont want the '' on the on. I want on not 'on'
You'll simply have to live with it, whilst you use the Bukkit Configuration API. Better use another API (like that from pyraeos) for your configuration if you place value on those things. Beside that 'on' and on are the same in YAML
I don't know what you're doing, but lets say its a command: Config: Code: Players: test: on: false Command: Code: if(cmd.getName().equalsIgnoreCase("turn")){ if(args.length == 3){ if(args[0].equalsIgnoreCase("player"){ if(args[2].equalsIgnoreCase("on"){ if(getConfig().getString("Players."args[1]".on").equals("false"){ getConfig.set("Players."args[1]".on", "true"); sender.sendMessage("Player "+ args[1] +" is now enabled!"); } else{ sender.sendMessage("Player "+ args[1] +" is already enabled!"); } } } } } What this does: If someone types in /turn player test on and on is set to false, it sets it to true. If on is set to true, it says "Player is already on!"