I'm using both OnEntityDeath(BasePlayer) and OnEntityDeath(BaseCombatEntity). Neither is catching my death in the safe zones.
Merged post
Been loggin my sleeper with BasePlayer.sleepingPlayerList. As soon as it's not in that list, I log in, and I'm dead. (With no hooks being triggered.)
I'll have to check if a dead safe zone sleeper makes a corpse. Maybe the server is nuking the GameObject directly so it doesnt make a corpse or backpack?
Merged post
Just saw an offline sleeper die, not in safe zone.
OnPlayerDeath(BasePlayer) - worked.
OnEntityDeath(BasePlayer) - worked.
I wrote a helper command to detect my sleeper. Logged out at 18:04 in the scientist compound. It could see my sleeper until 18:23. Next check did not find the sleeper. Nothing triggered. Logged in, definitely dead.
Merged post
I figured it out. When a player sleeps in a safe zone, it sets a timer to call BasePlayer.ScheduledDeath(). That method called BaseNetworkable.Kill() to get rid of the sleeper. Which triggers the OnEntityKill(BaseNetworkable) hook. Not OnEntityDeath or OnPlayerDeath.
Had someone watch while it happened. Sleeper disappeared and OnEntityKill triggered.