Ok, so me and my friend are having trouble getting an int from the config The problem is that either the droppedExp is set to 0 or it is set to default. PHP: @EventHandler public void onGiantDeath(EntityDeathEvent event) { Entity entity = event.getEntity(); if (API.isGiant(entity)) { event.setDroppedExp(API.getFileHandler().getInt(0, Config.CONFIG, "Giants Configuration.Giant Stats.Experience")); } } PHP: public int getInt(int fallBack, Config file, String path) { int i; try { i = (int) Math.round(getDouble(path, fallBack)); } catch (Exception e) { i = fallBack; } return i; } public double getDouble(String path, double fallBack) { double d; try { d = Double.parseDouble(path); } catch (Exception e) { d = fallBack; } return d; } Does anyone know a better approach to get an int from the config?
Well I'm not sure why you used PHP code blocks Anyways, just use the built in Bukkit Yaml Configuration. It comes with all functions for getting objects from the config. http://wiki.bukkit.org/Configuration_API_Reference
If it didn't work, you weren't doing it right... What did you try? it should be this.getConfig().getInt(path);