1.8.8 [SOLVED] [1.8] Player Death Event not firing

Discussion in 'Spigot Plugin Development' started by starfihgter, Feb 6, 2020.

  1. Hey guys, I feel like I'm missing something obvious but this event just isn't firing at all, the player being killed is not receiving any messages, and nothing is being written to the config. I've registered events properly as my inventory click event is working fine. Sorry it's a bit messy, I'm just trying to get it working first.

    Code (Text):
    @EventHandler
    public void onDeath(PlayerDeathEvent pDeath, Player player){
            player.sendMessage("check 0");
            if (player.getKiller() instanceof Player){
                player.sendMessage("check 1");
            String killer = player.getKiller().getName();
            if (config.getBoolean(killer + ".PVP.has", false)){
                player.sendMessage("check 2");
                int kills = config.getInt(killer + "PVP.kills", 0);
                int nKills = (kills + 1);
                config.set(killer + "PVP.kills", nKills);
                this.saveConfig();
                if (kills == 2){
                    player.sendMessage("check 3");
                    config.set(killer + "PVP.kills", 0);
                    config.set(killer + "PVP.has", false);
                    config.set(killer + "PVP.done", true);
                    player.sendTitle("§3BOUNTY COMPLETE","§bO murderer mine");
                    player.sendMessage("check 4");
                    long syscur = System.currentTimeMillis();
                    config.set(killer + "PVP.time", syscur);
                    this.saveConfig();
                }

            }

    }
    }
     
  2. Remove the second parameter.
     
    • Like Like x 1
  3. I'm an idiot. Thanks a ton!