Unable to teleport to a player's bed with `b:playerbed`
akrantz01 opened this issue ยท 5 comments
Information
-
Server version:
This server is running Paper version git-Paper-284 (MC: 1.16.4) (Implementing API version 1.16.4-R0.1-SNAPSHOT)
-
Full output of
/mv version -p
: https://paste.gg/p/anonymous/dfd1f0e7510f420aae13e1aab2ad6553 -
Server log: https://gist.github.com/akrantz01/c0c8248b344bc61edb1a19d4633302be
Help request
Problem
I'm trying to setup a portal to teleport a player to their bed location from a spawn hub. I ran into an issue where using the destination b:playerbed
does not work. Whenever I go through a portal with that destination, a NPE is thrown in MVPPlayerMoveListener.java. The same thing also occurs when using /mvtp b:playerbed
, however no NPE is thrown.
What I have tried
I have tried using /mvtp b:playerbed
and specify a specific player's bed with b:<playername>
. Providing a specific player for the bed to teleport to works with both portals and /mvtp
.
Closed by #594/#602. Thanks for the PR @akrantz01!
I believe this is a known bug (Multiverse/Multiverse-Core#2265). For now I'll this issue open as it may be a separate MV Portals bug.
Oh yeah, I saw that bug earlier but I thought it would be good to create a new issue since it was a different error. I also couldn't reproduce that error using /mvtp b:playerbed
.
I'll do some more testing tonight to see if I can get some more information about the bug(s).
Ok, so I think I have it figured out. There were two issues at play:
- When no bed was found,
d.getLocation(p)
would be null and cause the NPE to be thrown - Teleporting to the bed of the player going through the portal flat out doesn't work. The player would always be considered valid and cause
playername
variable to be set which determines whether to teleport to the bed of the player going through a portal or some other player's bed.
The first issue originated in this repo, and the other in Multiverse-Core. I'll make a pull request in each repository to fix the issues.