Hello, I have some problems with configs, i've made a inventory GUI here's the code: Code: @EventHandler public void onInterractGui(InventoryClickEvent event) { Player player = (Player) event.getWhoClicked(); if (!main.choix.contains(player.getName())) return; switch (event.getCurrentItem().getType()) { case IRON_SWORD: chevalier(player); player.closeInventory(); break; default: break; } } And this is the second part Code: public void chevalier(Player player) { String Classe = "Classe." + player.getName(); String CurrentClasse = "CurrentClasse." + player.getName(); if (getConfig().contains(Classe + "chevalier")) { player.sendMessage(ChatColor.GOLD + "Votre nouvelle classe est" + ChatColor.DARK_BLUE + "Chevalier"); getConfig().set(CurrentClasse, Integer.valueOf("chevalier")); saveConfig(); player.closeInventory(); main.choix.remove(player.getName()); } } Sorry but i'm a beginner and i don't know how to make this works :/ Thanks for help
In the bit of code below, i think you may have missed out a . in the 6th line. I have posted a possible correction below. Code:java public void chevalier(Player player) { String Classe = "Classe." + player.getName();String CurrentClasse = "CurrentClasse." + player.getName(); if (getConfig().contains(Classe + "chevalier")) { player.sendMessage(ChatColor.GOLD + "Votre nouvelle classe est"+ ChatColor.DARK_BLUE + "Chevalier");getConfig().set(CurrentClasse, Integer.valueOf("chevalier"));saveConfig(); player.closeInventory();main.choix.remove(player.getName());}} Code:java if (getConfig().contains(Classe + ".chevalier")) {