Hey im trying to code a Combatlog plugin. When a player logs out (combatlogs) he is killed and drops all the items he had in his inventory(because he died). But the way it is atm the player dies yes, but he does not drop any items. Any help? Code: @EventHandler public void CombatLog(PlayerQuitEvent e) { Player p = e.getPlayer(); String combatlog_msg = KitPvP.getPlugin().getLanguage().CombatLog_combatlogged.replaceAll("%p", p.getName()); if(KitPvP.getPlugin().getCombatLog().combatlog.contains(p)) { KitPvP.getPlugin().getCombatLog().death.add(p); p.setHealth(0); KitPvP.getPlugin().getCombatLog().death.remove(p); for(Player all : Bukkit.getServer().getOnlinePlayers()) { all.sendMessage(combatlog_msg); } } } P.S The death arraylist is for something else ignore it i need it like that.
Thank you this worked although now looking through my code again i noticed the main reason why it was not working was because i had another PlayerQuitEvent which cleared the inv of the player. I now fixed that and doing p.setHealth(0) is enough and works fine (srry for me being stupid(again))