Skip to content

Conversation

luigiofthebakery
Copy link

When using the teleport command, rotation (pitch and yaw) was not preserved when teleporting to an entity, or in any situation where it wasn't explicitly specified in the command parameters. The first commit fixes that.
The second commit adds back PlayerChangedWorldEvent to fire after teleportAsync is called, if the entity is a player and they are teleporting to a new world.

Comment on lines +14735 to +14738
+ this.getBukkitEntity().taskScheduler.schedule((Entity entity) -> {
+ org.bukkit.event.player.PlayerChangedWorldEvent changeEvent = new org.bukkit.event.player.PlayerChangedWorldEvent(((ServerPlayer)entity).getBukkitEntity(), from);
+ org.bukkit.Bukkit.getPluginManager().callEvent(changeEvent);
+ }, null, 1L);
Copy link
Contributor

@Euphillya Euphillya Sep 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is the good solution, because here we have 1 tick delay after the player has changed world

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants