[SPIGOT-5217] PlayerRespawnEvent fires when players teleport from the end back to the main world Created: 26/Jul/19 Updated: 09/Apr/23 Resolved: 09/Apr/23 |
|
| Status: | Resolved |
| Project: | Spigot |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Irmo van den Berge | Assignee: | Unassigned |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | 1.14.4, PlayerRespawnEvent, end, player, respawn | ||
| Version: | This server is running CraftBukkit version git-Spigot-9de398a-9c887d4 (MC: 1.14.4) (Implementing API version 1.14.4-R0.1-SNAPSHOT) |
| Guidelines Read: | Yes |
| Description |
|
The PlayerRespawnEvent fires when players 'respawn' after jumping into an end portal in the end. This did not happen on 1.13.2 and before. There is no clear reason why this is the case, considering there are portal and world change events already. Because in a plugin of mine I assumed the respawn event meant the player died, it resulted in a bug where people teleporting from the end had their state reset. I had to introduce an extra check specific to MC 1.14+ to also check that the player's health is 0. I have seen from the NMS code that the respawn logic after teleporting out of the end is very similar to when the player dies, but the event itself has no properties that allows me to check which kind of respawn occurred. Bed spawn might be an indicator, but is it reliable? I don't know if checking health is reliable either. Just in case this is actually a bug and not an intended feature change of 1.14, I'm reporting this as a new issue. |
| Comments |
| Comment by Shane Bee [ 25/Feb/20 ] |
|
I just came across this issue when someone reported an issue with my plugin. Same situation, stats are reset when returning from the end. I guess a "fix" could be adding a RespawnReason, like RespawnReason.DEATH |
| Comment by Irmo van den Berge [ 27/Jul/19 ] |
|
I tested this in 1.13.2 and it did not happen there. I can not confirm whether this bug also existed in some versions before that. |
| Comment by Black Hole [ 26/Jul/19 ] |
|
If the player is viewing the end credits he's in a special state much like dead. If the player cancels the end credits he is respawned at his spawn point. I remember that this event was called even before 1.9 if the player quit displaying the end credits. |