How to detect if a player dies?

Are there ways to detect a player's death? One through player kills and one through the environment? I want to use it for custom kill effects in a PVP mini-game.
Continue to help post