Use death event instead of entitydamagebyentity
Fix operations order, so player can be teleported