Never respawn the player inside a rock, in the lava or high in the air
After a wall is built over the old bed, or the land is regenerated, the saved respawn point can lie somewhere the player cannot live. This entry gives the AI a search for the nearest good place that always gives the same answer and says when there is none.
Why this works
A saved place is a memory of how the world looked, not a promise about now. Check the place each time it is used, and search outward in a fixed order for the closest good spot, so the player always lands somewhere reasonable and the answer is repeatable.
When not to use it
The nearest good place can be wrong in meaning, as a ledge on the wrong side of a locked door or a spot inside an enemy camp. In such worlds, mark safe areas on purpose and respawn at those, not at whatever is nearby.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 2 common mistakes and the fix
- 23 lines of example code with 5 checks that pass
- How your AI shows you that it works
Say this to your AI
Use the Spielerando entry "Never respawn the player inside a rock, in the lava or high in the air" (read_entry respawn-inside-a-wall) in my game. Build it step by step, and show me how you checked that it works.Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP