I have a PlayerMoveEvent where I check if a player is below Y 50, if so I teleport them back to spawn. Now I want to get the "killer" of the person, who knocks them of the platform. Therefore I did this in my PlayJoinEvent Code: Player killer = (Player) player.getLastDamageCause().getEntity(); But Iam just getting the player who gets attacked and not the actual attacker
@MiBB3L The Entity#getLastDamageCause() method returns an instance of EntityDamageEvent. You can check if this event is an instance of EntityDamageByEntityEvent and then cast it to that and use EntityDamageByEntityEvent#getDamager() to get the last attacker.