Skip to content

Apply destination rotation in TeleportUtils when copyRotation is true - #552

Open
DevModee wants to merge 1 commit into
PaperMC:ver/26.3.xfrom
DevModee:copy-teleport-destination-rotation
Open

DevModee wants to merge 1 commit into
PaperMC:ver/26.3.xfrom
DevModee:copy-teleport-destination-rotation

Conversation

@DevModee

Copy link
Copy Markdown

/tp <targets> <destination> moved the targets to the destination entity but they kept their own yaw and pitch. TeleportCommand passed the destination's rotation into TeleportUtils.teleport, but TeleportUtils never used those parameters and always called teleportAsync with null rotation. Those values were also read on the command source's thread, so they could be stale when the destination belongs to another region.

This replaces the Float yaw, Float pitch parameters with boolean copyRotation. When it is true, the yaw and pitch come from the Location that TeleportUtils already reads on the destination entity's own region, so nothing is read off-region.

  • TeleportCommand#teleportToEntity passes true
  • the spectator camera paths (ServerPlayer#teleportToCameraOffRegion and SPECTATE in ServerGamePacketListenerImpl) pass false, same behaviour as before

Ender pearls and the lookAt / facing handling in performTeleport are left alone, as noted in the issue.

Ran rebuildMinecraftPatches and ./gradlew build (compile, checkstyle, tests), all passing.

Fixes #547

@DevModee
DevModee force-pushed the copy-teleport-destination-rotation branch from 68447fa to 071a4b4 Compare November 30, 2026 21:38
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.

/tp <targets> <destination> doesn't apply the destination entity's rotation

1 participant