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

Human teleport bug #5510

Open Laith98Dev opened 1 year ago

Laith98Dev commented 1 year ago

Issue description

Steps to reproduce the issue

  1. create entity exetnds Human
  2. spawn it
  3. use teleport() function

OS and versions

Plugins

DevTools v1.15.0, MultiWorld v1.7.0-beta3, TestTeleportBug v1.0.0

Crashdump, backtrace or other files

No crashdumps

i was testing it in my test server ip: test.askills.xyz port: 19135 you can join and test it by using this command /test spawn /test tpme /test despawn or u can use the plugin in your server

and my test plugin is TestTeleportBug.zip

Video of the problem: https://cdn.discordapp.com/attachments/373214753147060235/1063228775963303936/Untitled_48_1080p.mp4

SleepSpace9 commented 1 year ago

There seems to be a timing issue, because it mostly works when you spawn the entity delayed after teleportation.

Laith98Dev commented 1 year ago

After some tests i have fixed it by override teleport function and despawn the entity then teleport it and re spawn it after 2 ticks

test plugin with the fix: TestTeleportBug.zip

dktapps commented 1 year ago

I suspect that just delaying the PlayerListPacket TYPE_REMOVE to remove the fake player would be sufficient. PlayerSkinPacket might also work (it broke a while ago, but it's possible it was fixed).