Multiverse-Portals

Multiverse-Portals

2M Downloads

Unable to teleport to a player's bed with `b:playerbed`

akrantz01 opened this issue ยท 5 comments

commented

Information

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.

Screenshots
in game

commented

Closed by #594/#602. Thanks for the PR @akrantz01!

commented

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.

commented

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).

commented

That'd be great, thanks.

commented

Ok, so I think I have it figured out. There were two issues at play:

  1. When no bed was found, d.getLocation(p) would be null and cause the NPE to be thrown
  2. 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.