Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion server/player/player.go
Original file line number Diff line number Diff line change
Expand Up @@ -2866,7 +2866,9 @@ func (p *Player) checkEntitySteppers() {

// checkOnGround checks if the player is currently considered to be on the ground.
func (p *Player) checkOnGround(deltaPos mgl64.Vec3) bool {
box := Type.BBox(p).Translate(p.Position()).Extend(mgl64.Vec3{0, -0.05}).Extend(deltaPos.Mul(-1.0))
// Probe straight down (0.05 plus this tick's descent) instead of along the
// whole movement, so a block the player falls past at its side is not ground.
box := Type.BBox(p).Translate(p.Position()).Extend(mgl64.Vec3{0, -0.05}).Extend(mgl64.Vec3{0, math.Min(deltaPos[1], 0)})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

missunderstanding the cause... (won't work) 👏

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks for taking a look — could you share a concrete failing scenario? I'd like to make sure I'm not missing something.

The change keeps the player's exact X/Z footprint and extends the probe box straight down by 0.05 plus this tick's descent (math.Min(deltaPos[1], 0)), instead of the old .Extend(deltaPos.Mul(-1.0)). While falling, deltaPos[1] is negative, so the old -deltaPos extended the box upward and sideways (opposite the movement) — that is what made it intersect a wall the player was sliding past and report onGround every tick, continuously resetting fallDistance (the #1003 bug). The new box only grows downward under the feet, so a block beside the fall path is no longer treated as ground while ground actually under the feet still is.

I tested this in-game on 1.26.30: sprinting/walking down stairs deals no fall damage (#1044 stays fixed), a ~15-block open fall deals ~6 hearts, and falling flush against a wall now deals damage only on landing (#1003 fixed). I also checked the edge cases (standing, ledges, jumping where math.Min clamps to 0, and fast falls where checkBlockCollisions has already clamped the position onto the floor).

If your point is that onGround should ideally come from the move's vertical-collision result (like vanilla) rather than a probe box — I agree in principle, but checkBlockCollisions only runs when deltaPos.Len() <= 3 and collidedVertically is also set on ceiling hits, so switching to it is a riskier refactor I'd rather keep separate from this fix. Happy to dig into any specific repro you have.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Absolutely! Here's an example scenario of this happening: https://www.youtube.com/watch?v=IlZ-Lclu54E

b := box.Grow(1)

epsilon := mgl64.Vec3{mgl64.Epsilon, mgl64.Epsilon, mgl64.Epsilon}
Expand Down