Solved The NPE that I can't explain

Discussion in 'Spigot Plugin Development' started by ZBLL, Jun 13, 2021.

Thread Status:
Not open for further replies.
  1. Code:
    Code (Java):

    @EventHandler
    public void onDeath(PlayerDeathEvent e) {
        EntityEquipment eeq;
        if (e.getEntity().getKiller().getEquipment() == null) eeq = null; else eeq = e.getEntity().getKiller().getEquipment();
        // more stuff later ofc
    }
     
    Pretty simple, but it for some reason gives me an NPE each time I die. Could you tell me why does it happen? I've been trying to solve this for quite a while and I don't see it.
     
  2. Nevermind, the reason is my code after that (and it's a very dumb reason lol)
     
Thread Status:
Not open for further replies.