Skip to content

Fix nether portal linking (#793): don't scale Y by dimension multiplier#905

Open
QueenRose4444 wants to merge 1 commit into
ryanhcode:mainfrom
QueenRose4444:fix/nether-portal-y-scaling
Open

Fix nether portal linking (#793): don't scale Y by dimension multiplier#905
QueenRose4444 wants to merge 1 commit into
ryanhcode:mainfrom
QueenRose4444:fix/nether-portal-y-scaling

Conversation

@QueenRose4444
Copy link
Copy Markdown

Fixes #793

Problem
NetherPortalBlockMixin applies the dimension coordinate multiplier (8x for Nether→Overworld, 0.125x for Overworld→Nether) to all three axes (X, Y, Z) when calculating the portal destination target position. Vanilla Minecraft only scales X and Z — the Y coordinate is never scaled by the dimension multiplier.

This causes the portal search target to have a wildly incorrect Y value (e.g., Y=118 becomes Y=944 when going Nether→Overworld), resulting in the game selecting the wrong destination portal.

Fix
Remove * multiplier from the Y coordinate in the clampToBounds call (line 31 of NetherPortalBlockMixin.java).

Tested
Verified fix resolves the issue in both singleplayer and multiplayer. Portal linking now correctly selects the closest portal by Euclidean distance, matching vanilla behavior.

… multiplier

The NetherPortalBlockMixin was applying the dimension coordinate multiplier (8x for Nether->Overworld) to the Y coordinate in clampToBounds. Vanilla only scales X and Z - Y is never scaled. This caused the portal search target to have an incorrect Y position, making the game select the wrong destination portal.
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 16, 2026

CLA assistant check
All committers have signed the CLA.

@ryanhcode ryanhcode self-assigned this May 16, 2026
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.

Netherportal Linking Behavior Affected

3 participants