Is there a way to detect where something dies

im trying to detcet where somthing dies so it can kill the nearest entity and im going to have like 20-50 entitys that i detect where tthay die
Continue to help post