Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: The End Exit portal does not teleport to overworld spawn #3139

Closed
2 tasks done
Maddin-M opened this issue Dec 2, 2024 · 9 comments
Closed
2 tasks done

[Bug]: The End Exit portal does not teleport to overworld spawn #3139

Maddin-M opened this issue Dec 2, 2024 · 9 comments
Labels
Bug: Unconfirmed Unsure if the issue/bug is valid.

Comments

@Maddin-M
Copy link

Maddin-M commented Dec 2, 2024

/mv version -p output

https://mclo.gs/89FYe9C

Server logs

https://mclo.gs/CcfmiTg

Server Version

[00:15:06 INFO]: Checking version, please wait...
[00:15:06 INFO]: This server is running Paper version 1.21.3-80-master@c2294d7 (2024-12-01T23:55:39Z) (Implementing API version 1.21.3-R0.1-SNAPSHOT)
You are running the latest version
Previous version: 1.21.1-52-e08e667 (MC: 1.21.1)

Bug Description

After defeating the Ender Dragon the Exit Portal is supposed to take you to the spawn of the overworld. Using Mutliverse, it takes me to the 0,0 coordinate of The End. Removing the plugin and restarting the server fixes the issue.

Steps to reproduce

  1. Create a new 1.21.3 server using Paper
  2. Add Multiverse Core 4.3.14 to the plugins dir
  3. Start server and join
  4. Go to The End and defeat the Ender Dragon
  5. Step into the Exit Portal
  6. You will most likely be teleported on top of the Exit Portal instead of the Overworld Spawn location

Agreements

  • I have searched for and ensured there isn't already an open or resolved issue(s) regarding this.
  • I was able to reproduce my issue on a freshly setup and up-to-date server with the latest version of Multiverse plugins with no other plugins and with no kinds of other server or client mods.
@Maddin-M Maddin-M added the Bug: Unconfirmed Unsure if the issue/bug is valid. label Dec 2, 2024
@Maddin-M Maddin-M changed the title [Bug]: End Exit portal does not teleport to overworld spawn [Bug]: The End Exit portal does not teleport to overworld spawn Dec 2, 2024
@zax71 zax71 transferred this issue from Multiverse/Multiverse-Core Dec 3, 2024
@Maddin-M
Copy link
Author

Maddin-M commented Dec 3, 2024

Now that the issue was moved to MV-NP: Adding the NetherPortals plugin yields the same result.

@Maddin-M
Copy link
Author

Maddin-M commented Dec 3, 2024

After debugging for a bit, I could see that the event in the playerTeleport(PlayerTeleportEvent event) EventHandler might be at fault (Link to line).

event.getTo() returns

Location{world=CraftWorld{name=lobby_the_end},x=0.0,y=60.0,z=0.0,pitch=0.0,yaw=0.0}

instead of lobby, the normal world. It seems to me that MV edits this event somewhere, but I couldn't find the exact point yet.

@zax71
Copy link
Member

zax71 commented Dec 3, 2024

Now that the issue was moved to MV-NP: Adding the NetherPortals plugin yields the same result.

Oh, is this occurring without MVNP? I'll move it back

@Maddin-M
Copy link
Author

Maddin-M commented Dec 5, 2024

Yes, this occurs with just Multiverse-Core aswell.

@zax71 zax71 transferred this issue from Multiverse/Multiverse-NetherPortals Dec 5, 2024
@Maddin-M
Copy link
Author

Maddin-M commented Dec 6, 2024

I'm starting to believe this is an issue on my end, as I had some more time for testing, and went back as to MC 1.16 and MV 4.1.0 and this still happened for me (on freshly generated worlds), and I don't believe this is an issue for this long. I'd love to know if someone can reproduce this using my steps.

@Maddin-M
Copy link
Author

Maddin-M commented Dec 8, 2024

So, I stumbled upon this issue: PaperMC/Paper#8469 and quickly hacked this together as a workaround, which works fine for me:

@EventHandler(priority = EventPriority.HIGHEST)
public void entityPortalEnter(EntityPortalEnterEvent event) {
    var world = event.getLocation().getWorld();
    var isEnd = world != null && world.getEnvironment() == World.Environment.THE_END;
    var isEndPortal = event.getLocation().getBlock().getType() == Material.END_PORTAL;
    var entity = event.getEntity();
    if (isEnd && isEndPortal && entity instanceof Player) {
        var overworldName = world.getName().replace("_the_end", "");
        var overworld = worldManager.getMVWorld(overworldName);
        if (overworld != null) {
            Logging.finer("Teleporting player from end portal to overworld spawn");
            plugin.getServer().getScheduler().scheduleSyncDelayedTask(
                    plugin, () -> entity.teleport(overworld.getSpawnLocation()), 1L
            );
        }
    }
}

@benwoo1110
Copy link
Member

See #2160

The solution is to set respawnworld as follows: /mvm set respawnworld <overworldname> <end WorldName>

@zax71
Copy link
Member

zax71 commented Dec 30, 2024

Oh wow i should have seen that

@Maddin-M
Copy link
Author

Maddin-M commented Jan 5, 2025

See #2160

The solution is to set respawnworld as follows: /mvm set respawnworld <overworldname> <end WorldName>

Works perfectly!

@Maddin-M Maddin-M closed this as completed Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug: Unconfirmed Unsure if the issue/bug is valid.
Projects
None yet
Development

No branches or pull requests

3 participants