EssentialsX

EssentialsX

2M Downloads

EssentialSpawn has no safety checks on PlayerRespawn

TreeDB opened this issue ยท 5 comments

commented

Details

Description:
EssentialsSpawn does not appear to do safety checks of the location when teleport-safety is set to true.

Steps to reproduce:

  1. Set essentials to spawn you to your home location
  2. Enable fly with /fly
  3. Do /sethome high enough to cause you to take enough fall damage to die
  4. Land and disable fly with /fly
  5. Die
  6. You will respawn in the middle of the air and fall to your death since fall damage will be taken

Upon review of the code it appears to be these lines:

Unlike the /home command the respawn location is being set without safety checking if it is enabled.

Expected behavior:
The expected behavior is to spawn to a safe location rather then mid-air when teleport-safety is set to true

commented

At the same time, you just setting a safe spawn in the first place would fix this issue.

Not sure whether respawning counts as a teleport within the game. Is there any reason in the first place that you are setting an unsafe spawn?

Sometimes, player homes can be sabotaged by other players or world events. It is rather unfortunate to attempt teleporting home to your previously perfectly intact sky base, only to find you've signed your own death certificate.

Choosing an unsafe spawn position aside, Essentials-Spawn claims to manage the spawning of players and because of that I believe it falls within the scope of the extension to ensure spawn locations are safe.

commented

Not saying that this should not be fixed, but isn't kinda your own doing if you decide to set home in the sky...?

commented

Not sure whether respawning counts as a teleport within the game. Is there any reason in the first place that you are setting an unsafe spawn?

commented

These do not run through our normal teleport code as Essentials is merely editing the respawn location through the PlayerRespawnEvent.

If this were to be added, we'd need to run our LocationUtil safety checks before setting the player's spawn location.

At the same time, you just setting a safe spawn in the first place would fix this issue.

commented

Not sure whether respawning counts as a teleport within the game. Is there any reason in the first place that you are setting an unsafe spawn?

If essentials is configured to teleport to a player's home on death, then it will be wherever they sethome. You can sethome while flying elytra, and this would be caused by the player's own doing.

These do not run through our normal teleport code as Essentials is merely editing the respawn location through the PlayerRespawnEvent.

If this were to be added, we'd need to run our LocationUtil safety checks before setting the player's spawn location.

At the same time, you just setting a safe spawn in the first place would fix this issue.

I haven't looked too deep into Essentials to fix the issue caused by players setting home while flying (includes elytra and if they have /fly). It creates an odd problem as players can then use /home, and it teleports safely, but if their default spawning home is unsafe, they will die on respawn.