pmmp / PocketMine-MP

A server software for Minecraft: Bedrock Edition in PHP
https://pmmp.io
GNU Lesser General Public License v3.0
3.28k stars 1.56k forks source link

Ender pearl still teleporting to Vector after level change #3397

Open unickorn opened 4 years ago

unickorn commented 4 years ago

Issue description

I threw an ender pearl on level "pvp" and died before it fell down. I respawned at level "spawn" and got teleported to a ~random~ location which I think are the coords where the ender pearl might have fallen.

Steps to reproduce the issue

  1. Throw ender pearl
  2. Die before it falls
  3. Respawn at your original spawn point (in another level)

OS and versions

Plugins

dktapps commented 4 years ago

Most likely this is reproducible if you throw an epearl when you're far away from spawn and die before it lands. I doubt there's any world-specific logic in the mix. So far as I recall, there's no check for this.

dktapps commented 4 years ago

The most logical fix for this seems to be to have some kind of teleport counter on the player, and have the epearl record it. Then, if the counter doesn't match when the epearl lands, do not teleport the player.