I went to cut down some trees in my Survival world, when I saw a tree growing on sand.
Linked issues
Attachments
Comments 9
World Type: Large Biomes, I spawn in a snow biome when I go to those coords.
edit: tried again, now I'm in a swamp
edit2: attached screenshot
Very likely the same backing reason as for MC-610.
The trees are spawned on "right spot", the problem is that spot gets changed afterwards. In this case, the lake comes later, after which dirt-to-sand conversion is done (to create beaches near waters). In this example case, there is indeed a lake right next to the location. There are also other similar spots in the same world and same swamp - tree on top of sand near a lake. Not very common, though.
The sand generator code is indeed so simple that it only scans a defined radius around the randomly chosen water block for dirt or grass and converts it to sand. It ignores the existence of anything else there might be, like trees.
However, depending on how MC-610 gets fixed (if it gets), this issue may or may not go away at the same. (Edited: ) Lakes and these sand spots are created alike, as part of the "decoration process" which is supposed to happen after the chunk base generation, but have some inter-order issues with that ordering. The particular order of generating chunks can affect the outcomes, too.
Going to resolve this as a dupe of MC-610
Please provide the seed and the coordinates.