The bug (maybe?)
On at least one world seed, the default spawn point of the player is in the middle of an ocean with no land in sight. It is possible that this is not unintended behavior, but I find it unlikely that the game would at least check to make sure the player does not spawn on land.
How to reproduce
Open up Minecraft
Create a new world with the seed
4015
Generate the world
Observed result
The player spawns in the middle of the ocean.
Expected result
The player spawns on land.
Related issues
is duplicated by
Attachments
Comments


Please do not mark unreleased versions as affected.
You don't have access to them yet.
Usually Minecraft tries to put the worldspawn to some form of land, even if it's only a tiny island. What probably happened here, is that Minecraft couldn't find any land in the area it wanted to put the spawnpoint in. This might very well be the intended outcome (Try to find land, if there isn't any just default to whatever position).

Confirmed in 1.14.1... Make a "Large Biomes" world with the seed -904606106. I don't consider it a bug though, I like from time to time this kind of spawn, especially with the new ocean content from 1.13 upwards.
This is not really a bug. If there are no blocks to spawn on, you'll need to spawn in an invalid location, otherwise the game would need to search for a valid spawning spot indefinitely and might be able to enter an infinite loop.

For some specific seeds, etc: 414929, you can spawn in the middle of the ocean and couldn't see any land with render distance 32 chunks. (This seed has no land except mushroom fields from (-1024,-1024) to (1024,1024))
In Large Biomes, it could be even worse, ~13% seeds will spawn you in an ocean, including seed 0, and some seeds you need to swim thousands of blocks to find land.

Still in 24w40a with seed 20337 in Large Biomes

Still in 1.21.2-pre3 with seed 12345702767680896 (Normal Type World)

This is not exactly a bug because every seed is randomly generated, and if a seed has an ocean with only a small island at the spawn point, the game has to spawn the player there, or it will search for a long time, only to spawn the player thousands of blocks from (0,0). It may also be intended behavior as having to swim/boat to land is just the same as exploring to find a biome or structure. Plus, the spawn algorithm has been changed in 1.21.2, so that the player is 20x more unlikely to spawn in the middle of an ocean.