Skip to content

fix(physics): allow climbing through open trapdoors above ladders#359

Open
Semleks wants to merge 1 commit into
adepierre:masterfrom
Semleks:fix/trapdoor-fix
Open

fix(physics): allow climbing through open trapdoors above ladders#359
Semleks wants to merge 1 commit into
adepierre:masterfrom
Semleks:fix/trapdoor-fix

Conversation

@Semleks

@Semleks Semleks commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

The bot can now climb up through a trapdoor/hatch if it is open and aligned with the ladder underneath (same facing property).

I tested manually on my Arch Linux and vanilla server 1.21.11. So, it's work!

1.mp4
2.mp4

The bot can now climb up through a trapdoor/hatch if it is open
and aligned with the ladder underneath (same facing property).

@adepierre adepierre left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks for the PR, I added a few comments

Unfortunately, the reason it was a todo is because I don't really want to base things in the physics on block names and string comparison. If mojang decides to add something like a "broken_ladder" or change things so iron trapdoors don't behave the same as wooden ones this kind of hardcoded comparison will be hard to track down in the physics code and maintain.

// sqrt(front_vector.x� + front_vector.z�) to follow vanilla code
// it's equal to cos(pitch) (as -90�<=pitch<=90�, cos(pitch) >= 0.0)
// sqrt(front_vector.x� + front_vector.z�) to follow vanilla code
// it's equal to cos(pitch) (as -90�<=pitch<=90�, cos(pitch) >= 0.0)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

You have some encoding issues similar to the ones in your other PR.

// as the trapdoor then the trapdoor is a climbable block too
return feet_block != nullptr && feet_block->IsClimbable();
if (feet_block != nullptr && feet_block->IsClimbable())
return true;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

The if body should be between {} to be consistent with the rest of the repo.

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