Player in death screen spawning to the server causes SpawnEntityEvent


A killed player sees the death screen. He clicks on “Title screen” on the death screen to leave the server without respawning. Then the player joins the server again. He still sees the death screen and still has the choice for “Title screen” and “Respawning”.

What I want to do: Listen to an event that is fired when the player actually respawns. Without leaving the server and directly clicking on “Respawn” this does work. But first leaving the server and then rejoining to see still see the death screen fires the SpawnEntityEvent while still on the death screen. Then an additional SpawnEntityEvent is fired when the player eventually click on respawn.
To illustrate this behavior better:

The thing is: I would like to distinguish the last event in the left or right chain from the first event in the left chain. So basically, when the player actually is alive.

You might be able to use RespawnPlayerEvent which fires only when clicking respawn.

Oh… Thanks. I haven’t searched right for such a basic thing. :wink: