Skip to content

Improve bamboo collision - #6560

Open
ThioJoe wants to merge 1 commit into
GeyserMC:masterfrom
ThioJoe:Bamboo-Collision-Improvement
Open

Improve bamboo collision#6560
ThioJoe wants to merge 1 commit into
GeyserMC:masterfrom
ThioJoe:Bamboo-Collision-Improvement

Conversation

@ThioJoe

@ThioJoe ThioJoe commented Jul 18, 2026

Copy link
Copy Markdown

Improvement / fix for #6341 at least for bamboo

I had Fable 5 do this so I didn't make it myself, but I tested it and it is definitely an improvement.

Apparently some of the collision stuff is unavoidable because the rendered placement of bamboo is done by the bedrock client and is different than on the java server. This reduces teleporting especially when trying to walk between them, but since it's possible the player might legitimately be walking into the bamboo even if it looks like they're not, it's not completely unavoidable. But this tries to limit it.

On Java, bamboo's collision box is offset by a pseudorandom amount
derived from the block's X/Z coordinates (Mth#getSeed, clamped to
+/-0.125). Bedrock derives its offset differently, so bamboo stalks sit
on different corners of the block on each edition and the Bedrock
client will happily stand in spots that intersect the collision box the
Java server actually uses. The server then rejects such movement
("moved wrongly!") and teleports the player back, rubber-banding them
on every movement packet near bamboo.

Previously bamboo was simply skipped during position correction
(collisionIgnoredBlocks), and the collision box in the mappings was
baked at the offset of position 0,0 without the 0.125 clamp - wrong for
both editions at nearly every position.

This adds a BambooCollision translator that computes the Java
collision box for each block position, replicating vanilla's offset
algorithm including its int overflow and float division semantics, and
silently nudges the Java-bound player position out of that box so the
server always accepts the movement. Intersection and collision offset
computation (pistons, client vehicles) use the correct per-position box
as well.

The Bedrock-side model/collision offset itself is apparently a client limitation and cannot be changed without custom blocks, so the visual placement
difference remains.
@Novampr

Novampr commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Would be curious to know if this has been tested with the bamboo saplings (which have no collision) and the thicker version of bamboo? I suspect this will break in both cases.

@ThioJoe

ThioJoe commented Jul 19, 2026

Copy link
Copy Markdown
Author

I only tested with fully grown bamboo

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