This gives me a NullPointerExepiton when i try to acces something from the config , i think it dosen't create the config in the first place and just gives me a wierd error ( and i have my config file in my project ) Here is my main class onEnable : Code:java public void onEnable() { this.saveDefaultConfig(); getServer().getPluginManager().registerEvents(new LoginListener(this), this); getServer().getPluginManager().registerEvents(new TokenShop(this), this); this.getCommand("tokens").setExecutor(new Tokens(this)); log = getLogger(); try { this.mysql.setupDB(); } catch (SQLException e) { log.warning("Could not connect to database"); log.warning("Error:" + e); this.logDB = false; e.printStackTrace(); } } public void onDisable() { this.mysql.closeDB(); saveConfig(); } And here is my class where i get the error: Code:java public TokenShop(TokenPvp h) { TokenShop.main = h; } public static Inventory tokenshop = Bukkit.createInventory(null, 27, ChatColor.BOLD + "Token Shop"); static { TokenPvp.createDisplay(Material.BONE, tokenshop, 0, ChatColor.GREEN + "Wolf Pet", ChatColor.GRAY + "Get your wolf pet now and you won't regret it!" + ChatColor.GREEN + String.valueOf(main.getConfig().getInt("Wolf"))// ERROR right here + " TOKENS"); } Yeah and it gives me a nullpointer , maybe the config is not creating ? I don't know Trace
NullPointerExceptions that are being caused by variables are generally thrown when some part of the .getConfig(); method is null.