Skip to content

Fix player spawn sometimes chosen midair above cavern - #3550

Open
yel0h wants to merge 2 commits into
PixelGuys:masterfrom
yel0h:player-spawn
Open

Fix player spawn sometimes chosen midair above cavern#3550
yel0h wants to merge 2 commits into
PixelGuys:masterfrom
yel0h:player-spawn

Conversation

@yel0h

@yel0h yel0h commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

isValidSpawnLocation now also queries the CaveMap at the candidate column to confirm there's solid ground at the surface height and clear air above it to stand in, rejecting the candidate and letting the spiral search keep looking otherwise. Also made the 2D height calculation run when no valid location was found.

Example test seed with this bug: 9071844392573517448

Fixes #2097

@Wunka Wunka moved this to High Priority in PRs to review Aug 23, 2026

@IntegratedQuantum IntegratedQuantum left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ideally you should check the actual chunk(s) it's in, not just the CaveMap. Otherwise there may still be problem with structure generation (e.g. you might spawn in a tree, or in a lava lake or whatever)

@IntegratedQuantum IntegratedQuantum moved this from High Priority to In review in PRs to review Aug 23, 2026
@yel0h

yel0h commented Aug 24, 2026

Copy link
Copy Markdown
Contributor Author

Okay, now also checks whether the actual generated blocks are safe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

It is possible for the player spawn position to be mid-air

3 participants