Fix: Teleports on chests causing players to get stuck#6421
Merged
onebeastchris merged 8 commits intoMay 26, 2026
Conversation
We now check if the Bedrock player is standing on any blocks (currently, only chests) that have a different collision size
Camotoy
reviewed
May 20, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to prevent Bedrock players from getting stuck in a teleport loop when teleported while standing on blocks whose Bedrock collision height differs from Java (currently implemented for chests). It does so by computing an “adjusted” Bedrock-side teleport position and using it for teleport confirmation / client positioning.
Changes:
- Add a per-block hook (
BlockCollision#pushUpForTeleport) and implement it for chests to define a Bedrock-side Y “bump” for teleports. - Extend
TeleportCacheto store an adjusted teleport position and use it for teleport confirmation andSessionPlayerEntity#bedrockPosition()during unconfirmed teleports. - Refactor
CollisionManager#collidableBlocksIteratorto a static helper and update call sites.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/player/JavaPlayerPositionTranslator.java | Reorders teleport caching and introduces session-aware TeleportCache construction. |
| core/src/main/java/org/geysermc/geyser/translator/collision/fixes/SeaPickleCollision.java | Comment punctuation fix. |
| core/src/main/java/org/geysermc/geyser/translator/collision/fixes/ChestCollision.java | Adds chest-specific pushUpForTeleport() bump value. |
| core/src/main/java/org/geysermc/geyser/translator/collision/BlockCollision.java | Introduces pushUpForTeleport() API and Javadoc link. |
| core/src/main/java/org/geysermc/geyser/session/cache/TeleportCache.java | Stores adjustedPosition and uses it for teleport confirmation; constructors now take session. |
| core/src/main/java/org/geysermc/geyser/level/physics/CollisionManager.java | Makes collidableBlocksIterator static and updates internal use. |
| core/src/main/java/org/geysermc/geyser/entity/vehicle/VehicleComponent.java | Updates iterator call to new static helper. |
| core/src/main/java/org/geysermc/geyser/entity/vehicle/BoatVehicleComponent.java | Updates iterator call to new static helper and adds import. |
| core/src/main/java/org/geysermc/geyser/entity/type/player/SessionPlayerEntity.java | Adds adjustPositionForBedrock and uses adjusted teleport position while unconfirmed. |
| core/src/main/java/org/geysermc/geyser/entity/type/FishingHookEntity.java | Updates iterator call to new static helper and adds import. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1cd32d8 to
bfe1ee5
Compare
onebeastchris
commented
May 26, 2026
| public class CollisionManager { | ||
| public static final BlockCollision SOLID_COLLISION = new SolidCollision(null); | ||
| public static final BlockCollision FLUID_COLLISION = new OtherCollision(new BoundingBox[]{new BoundingBox(0.5, 0.25, 0.5, 1, 0.5, 1)}); | ||
| // If you read this, feel free to suggest a more proper way to detect else |
onebeastchris
commented
May 26, 2026
Changed POSITION_ADJUSTMENT_MARGIN to private and updated comment for clarity.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We now check if the Bedrock player is standing on any blocks (currently, only chests) that have a different collision size; and then bump the teleport position up. Otherwise, we teleport the player into the chest, which causes the player to "fall through it" - which causes the server to re-send the teleport, causing a loop. Thanks to oxy's ChestCollision impl we'd correct the movement to match Java collisions anyways, so this correction would be only on the Bedrock player's end.
To reproduce it currently:
/tp @s @sNote: AI tools were used in the making of the PR, but the final changes are manually reviewed & tested by me and do resolve the issue. Would appreciate a look over GeyserPlayerEntity#adjustPositionForBedrock - maybe there's a cleaner way to do it?