So in my code to determine if when 2 players hit each other they don't take damage Code:java public class PartnershipListener implements Listener { public static Partnership plugin; public void onEntityDamage(EntityDamageByEntityEvent event){ Entity damager = event.getDamager(); if(damager instanceof Player){ Entity damagee = event.getEntity(); if(damagee instanceof Player){ Player p = (Player)damagee; Player pp = (Player)damager; if(plugin.getConfig().getString(p.getName(), ".married").equalsIgnoreCase(pp.getName())){ event.setCancelled(true); }else{ event.setCancelled(false); } } } }} I keep getting a NullPointerException, which I can't figure out why, since I check to make sure if the damager/damagee is a player or not before converting the entity to a player and if the player name is not in the config shouldn't it just come up as false? Code: Caused by: java.lang.NullPointerException at me.wam19.ProtectionPlugin.Listeners.ProtectionPluginListener.onPlayer Interact(ProtectionPluginListener.java:45)
Ethan Look at the error, silly. It throws the NPE on "onPlayerInteract" method, not the method above. By the way, you forgot @EventHandler EDIT: Now that I look at it, I don't think it's even the same plugin.