Hi I am trying to pull a string out of the config file and conwert it to that "Material.DIAMOND" material below. Code (Text): if (player.getInventory().contains(Material.DIAMOND, getConfig().getInt("village1"))) The config.yml has these commands: material1: Material.DIAMOND village1: 10 I tryed different methods but I didn't manage to get it right Thanks in advance for any help
Use Material.valueOf(/* material1 */) and change your config to: Code (Text): material1: DIAMOND village1: 10
Material.getMaterial(String) would be more appropriate, if you want null istead of an exception if a material is not found.