Description:
Setting the world spawn beneath leaves will respawn the player on top of the leaves. In 1.12, leaves were ignored unless there was a solid block beneath them. Since /setworldspawn has been reverted to 1.12 behavior (see MC-245811 and MC-243079) this is inconsistent and can lead to issues (i.e. players being stuck on top of jungle trees).
Steps to Reproduce:
Open a world in 1.18.1 and another in 1.12.2.
/setworldspawn beneath leaves (be it through /fill or a natural tree).
(Optional) /gamerule spawnRadius 0 to test same location. If larger than 0, /fill radius with layer of leaves.
/kill and respawn.
Player will respawn in 1.12 on the ground and in 1.18 on top of the leaves.
Recommendation:
Reopen MC-243079 and return 1.13 - 1.17 /setworldspawn behavior. By default this bug would be resolved.
Sorry duplicated by MC-242348. I only filtered for "leaves" in search.