I have a problem with my DamageListener I want to remove the DamageAnimation when someone gets falldamage., but sometimes it works and sometimes it doesn´t. Does anyone have an idea why? Code: public void onDamage(EntityDamageEvent e) { Player p = (Player) e.getEntity(); if(e.getCause().equals(DamageCause.FALL)) { double damage = e.getDamage(); e.setCancelled(true); p.playSound(p.getLocation(), Sound.FALL_SMALL, 10, 1); if(p.getHealth() <= damage) { p.setHealth(0.0D); }else { p.setHealth(p.getHealth()-damage); } } }
if(p.getHealth() <= damage) { p.setHealth(0.0D); } If the player is full and takes 10 damage, and the players health is now at 10, wouldn't p.getHealt() = damage? Just a thought.