Summary:
If you have your respawn point set using a bed or respawn anchor, the game avoids respawning you on dangerous blocks. If you don't have a spawnpoint and therefore respawn at the world spawnpoint, this is not the case. If the gamerule spawnRadius is higher than 0, the game could avoid respawning you at dangerous blocks. This issue also allows you to make spawning traps for new players.
This affects the following blocks (list may be incomplete):
Magma blocks
Powder snow
Wither rose
Fire
Soul fire
Sweet berry bush
This does not affect the following blocks:
Campfire
Soul campfire
Pointed dripstone
Lava cauldron
This is likely due to them being non-full blocks.
Steps to reproduce:
Create a superflat world
/gamerule doImmediateRespawn true
/fill ~5 ~-1 ~5 ~-5 ~-1 ~-5 minecraft:magma_block
Run the following command multiple times:
/kill
Observed results:
Sometimes you will respawn on a magma block.
Expected results:
The game should avoid respawning you on dangerous blocks like magma blocks in this case.
Relates to MC-176640 and MC-102836.