Skip to content

Conversation

@abola2
Copy link

@abola2 abola2 commented Nov 1, 2025

Requires #4252

}

thisPlayer.setCamera(thisPlayer);
thisPlayer.setCamera(thisPlayer.getCamera());
Copy link
Member

Choose a reason for hiding this comment

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

This is equivalent to not calling setCamera at all. The line is here on purpose to stop spectating when changing dimension. The real problem is why is this line executed when the player is teleporting without changing dimension. I'm gonna investigate a bit.

Copy link
Member

@Yeregorix Yeregorix Nov 4, 2025

Choose a reason for hiding this comment

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

Turns out the method names impl$fireDimensionTransitionEvents and bridge$changeDimension are misleading. They are called for all teleports but have special treatment for actual dimension changes.

Copy link
Member

@Yeregorix Yeregorix Nov 4, 2025

Choose a reason for hiding this comment

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

Your fix causes positioning issues when spectating an entity and then teleporting. Whereas in pure vanilla it just stops spectating.

Copy link
Member

Choose a reason for hiding this comment

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

Something worth to mention is that recent versions have changed the behavior of how passengers and spectators are teleported, and make sure we follow vanilla.

Copy link
Author

Choose a reason for hiding this comment

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

Your fix causes positioning issues when spectating an entity and then teleporting. Whereas in pure vanilla it just stops spectating.

Nice catch! After digging into this, it seems the issue is caused because TeleportCommandMixin’s overwrite didn’t follow vanilla logic. In vanilla, the player’s camera would be set back to the player in teleportTo. I’ve opened #4252, another PR that restores the logic to match vanilla behavior.

@abola2 abola2 reopened this Nov 6, 2025
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.

3 participants