Note
19/May21: This has now been fixed for everything except trees. For any remaining or reintroduced issues, please open new and specific reports with new repro steps.
The bug
World generation places tall grass/double tall grass, flowers/double flowers, sugar canes, snow, trees, and possibly other things in places it shouldn't.
Affected situations
Sand/gravel patches generated around water (lakes/rivers/oceans/etc) have things growing on them:
/
tp @p 946 68 9609
/tp @p 1250 67 10150
/tp @p 1230 70 10333
/tp @p -898 64 44766
but on seed5384881648447775625
Lava and water lakes have floating plants and trees on top of them:
/tp @p 1100 66 10364
/tp @p 1111 66 10382
/tp @p 1636 63 11014
All examples given above work in 18w06a, on seed 7913388302499728605
.
Related issues
is duplicated by
relates to
Attachments
Comments

Confirmed.
Confirmed
Also happens with gravel, see MC-3437.
MisterSanderson, the screenshots you added have nothing to do with the reported bug. The bug I'm reporting here is about grass being placed on top of sand/gravel. Your screenshots show a bug about grass being placed off-center. As far as I've understood they're doing this on purpose to prevent grassy fields from looking the same all over the place. I agree this off-center grass could look better on edge-blocks, but please create a seperate bug for this.
Oops, sorry.
Can you also delete those pictures?
Done.
Thanks very much.
Uploaded an Image showing grass growing on gravel including position and seed.
World type is: Superflat (Preset: overworld)
Still present in 1.4.7
This issue seems to happen with Flowers as well (se image) the broken Flower was already there.
Snapshot 13w03a - Generated a superflat "overworld" preset map. Some grass spawned on sand, and some of these turned into seeds immediately after world generation. Confirmed in this screenshot: also happens with flowers.

Add the label "lake" to this issue.. Didn't find this one.
(Edited plenty, was too incorrect...)
Seems order of generation is ..., villages and other structures, lakes, "decorations" (trees, flower, etc.). This explains why lakes can carve themselves under temples and such, but not why there are trees and grass floating above them..
Anon Ymus, the sand comes likely from the lake generation.

superflat first creates the "base" material, after which comes lakes.. there could very well be more code after that which looks for things like "water next to dirt/grass -> convert to beach". I haven't checked for that (yet) as it seemed quite minor thing (and the generation code is also a bit of a maze).
Edit: Well, now I looked, and indeed there is such post-processing which exactly looks for dirt/grass near water and converts blocks to sand.

Okay, reason partially solved.
When "decorating" one chunk, the decoration process can randomly decorate a block that is actually in neighbor chunk (this is assumption so far, but considering how the decorations on the edges of generated world are always half a chunk "off"...). The world-object will happily generate the neighbor chunk if it does not exist yet (so that the decorative can be placed), and this generation does not yet include decoration; otherwise it could get into recursive infinite loop.
Thus, consider these events:
1. Have an already created a chunk (with no lake now or ever) and now decorating it, the decoration can "spill" into next chunk.
2. The other chunk's "base" gets created, without lake at this point, even if it will later have it.
3. The decorations get placed in that chunk, finding the ground at nominal level (e.g. 64 for the "overworld").
4. Later the other chunk will be decorated, too, now getting the lake it is supposed to have. Lake generation carves blocks out upto the ground level, replaces with water and air. And leaves the grass (and/or trees etc.) intact.
I added specific debugging messages to see when and where the game was generating grass and lakes, in a specific area I knew would have a lake with floating stuff. Results looked like this:
Generating grass in -218, -39, 64
Generating grass in -218, -37, 64
Generating grass in -218, -35, 64
Generating grass in -216, -38, 64
Generating grass in -215, -32, 64
Generating grass in -217, -41, 64
Generating grass in -213, -29, 64
Generating grass in -217, -29, 64
Generating grass in -219, -37, 64
Generating grass in -219, -38, 64
Generating grass in -216, -30, 64
Generating grass in -211, -41, 64
Generating grass in -215, -40, 64
Generating grass in -209, -41, 64
Generating grass in -208, -39, 64
Generating grass in -213, -41, 64
Generating lake at: -222, -44, 63 (+16, +16 for area covered)
Generating grass in -215, -30, 64
Generating grass in -208, -40, 64
Generating grass in -212, -40, 63
Generating grass in -212, -41, 64
Generating grass in -214, -32, 63
Generating grass in -210, -39, 63
Generating grass in -214, -30, 64
Generating grass in -216, -29, 64
Notice how grass gets created at height 64 over the future lake's area first, then the lake is created, and some grass being planted later can also get to the one block lower height (lake edges).
Have fun figuring out how to fix that! Took 2 hours to figure out the reason, it is 5 in the morning, I'm off to bed.
Couldn't the lake generation and lake edgeing code simply check for grass and flowers on/over the blocks it is changing and remove them?

Sure, they could, but that would be only a workaround (i.e. removing the symptom), bound to cause new problems sometime in future. It is always better to try to fix the cause (in this case the incorrect order of generation of various features).
Also, that workaround would only fix the flowers and grass (single block stuff, always immediately above the blocks cleared by the lake). What about melons, pumpkins, mushrooms. Then sugar cane and cactus (can be taller than one block, but still "easy" being in single column). But what about trees? Their removal is very difficult after they have been created. Or parts of temples. (And I'm even leaving out something just to let people start thinking what it might be, and realize what kind road of traps that path will be.)
Or whichever future terrain feature not known yet.
And there are some problems even underground (rare though).
The idea is, one does not want to code "exceptions" (not talking about the concept for error handling in various programming languages) and/or spread knowledge about features into other features; that is, lake generation should not need to know anything about any other features (or other features about lake generation). It makes the maintainability of the code base difficult, slow and expensive. Minecraft is already quite a big mess in that way. It would be better to try to make things right instead of adding yet another knot into that mess.
Edit: If they fix the cause (so that the lakes would always get generated before those other features), all the details/exceptions/knowledge about other features becomes unneeded. It would be sort of easy solution. Unfortunately, ensuring that order in all cases won't be that easy due to the way the terrain generation has been designed.
Basically, the choice is between possibly difficult but right and better for future vs. semi-easy-to-difficult but wrong and pain in the future. (The variable difficulty for the latter comes from whether they decide to ignore the difficult trees and such or not).
Wouldn't it be the best solution to generate lakes, villages and whatnot first and then generate decorations.
Same issue with sand generating while floating. It does not receive an update, therefore it does not correct its problem.

Kevin, as I wrote (perhaps a bit unclearly), that would indeed be the best solution, but also possibly very difficult to implement. The way the world is generated is quite "messy", and getting the process absolutely right is near nightmare, if not even impossible.
(EDIT: A further thought into the issue, and realized the following alone won't fix it..)I personally might even go with a bit of brute force and ignorance; generate the first (non-decoration) stage a couple extra chunks more "outwards" than where the second (decoration) stage is being done. Even this might not be enough for the most kinkiest or largest features (if there are any such), but at least the current decoration process (which only covers relatively small range) would be fully covered and thus cause no issues like this. This brute force solution would incur a bit more terrain generation overhead (both processing and memory) than now, but not radically more so.
Xavier Brown: yes, if the relevant terrain features remove stuff under sand, that sand is not given an update. However, I've seen on one map that at least near the spawn point, the local floating sand always fell down after predictable delays (in two sequences); I was regenerating the world several times for another bugfix testing, so I saw the sand falling as many times. However, I've also seen some locations were the sand never falls by itself. (Also, the floating grass can slowly go away as they get the random world updates, etc.)

We actually like the quirks like this.
Still present in 1.6.4 and 1.7.x
Will this be resolved in a future version?
Too bad that this gets a "won't fix."
(If possible , I attached a screeny of me finding a double fern on sand)
I encountered a case in 14w11b where the flowers that were generated on gravel uprooted themselves before I even saw them. Was this just a chance occurrence, or was something fixed between now and February 2013?

It (and other variants of the same kind) is quite common stuff, and as mentioned few comments above, Mojang has decided to "won't fix".
EDIT: read the comment too quickly... The automatic uprooting isn't part of the issue or "won't fix", of course, but afaik it has been around for quite a while, too; it just depends on random chance when a block update happens or if the player does something that causes a block update for the flower. The same applies to many other bugged world generation issues like floating sand/gravel, non-flowing water blocks, etc.
Alright thanks. I guess I'm not fully read up on when block updates are executed (and as I understand it, and as you've said, there is a random element in there somewhere).
Actually would be incredibly simple to solve this, have done so in a Bukkit world generator before, which uses the same basic chunk generation system. The solution is simply to do the following:
1) chunk a gets generated
2) checks all 8 chunks around it (3x3 chunk area not including itself)
3) for any of these chunks which is also surrounded by 8 loaded/generated chunks, populate/decorate it.
(You MUST make sure to populate/decorate things in the right order per-chunk).
I find this method does not cause much lag (even on a laptop), works every time (no chunks without decoration/structures), and so far NEVER produces any issues. It even fixes the thing where trees in cold biomes can sometimes be half-covered in snow and the other half is underneath it.
For strucutres that could potentially take an area that sticks out of that 3x3 chunks area, simply increase to a 5x5 chunks or more area for those particular structures. Since it doesn't generate one super-often, the potential lag from this many checks would be probably un-noticeable on a decent computer.
PS: as for why I actually need to leave a 1 chunk no-decorate/populate border around things, it causes other issues if I don't
PPS: it seems there is something like this in Minecraft already, explaining why trees never get cut off on chunk borders, and how larger-than-a-chunk structures generate properly, but it doesn't seem to be fully implemented in the way I have suggested, as there are some issues, as we have seen here.

@Conor McS
Your suggestion is a decent compromise, not too much CPU/memory load, yet significant reduction on visible issues.
The existing check is more of half-a-chunk thing. Sort of; the decoration process happens with half-chunk shift compared to chunk generation. That causes its own issues.
The large structures (like mines, caves and villages) work out semi-properly because they can be generated for any sub-section at any time, even if the rest of it are still in area that is not generated. (Though the way they are generated is in most cases rather inefficient, but that is another story). "Semi-properly" - e.g. the issue where farms in villages had weird leaking water was caused (partially) because of the combination of decorating with half-a-chunk shift and only smaller area at a time.
The method you described was in my mind back then, too, but it doesn't scale properly. As you already mentioned, larger structures would need larger "buffer", e.g. large caves/mines could very well not generated until the player has traveled almost half way through their area... pop a cave entrance appears under your feet and you fall to your death. To avoid such side-effects, the chunk generation area would need to be extended accordingly, and that is not cheap.
Also, another issue is that the decoration should be done in multiple iterations, depending on the natural order things would have happened. In a way it already does so (iirc, the decorations are added in two different groups, and in specific order), but it doesn't cover all random combinations correctly.
Theoretically the extension of both generation distance and the checking buffer distance is the only "correct" way to do it. It is just one of the cases where theoretically correct is too hefty for CPU/memory.
When will people realise that '@' tags don't do anything on here?
Anyway, I have seen no issues so far with caves and similar things, as they appear to be generated chunk-by-chunk, in the same sort of way that rivers are, so as long as the player has a view distance of more than 1 chunk (smallest in vanilla is 2 chunks), there's no risk of falling into one due to it suddenly appearing. Also even on my slow laptop, with view distance set to 16 and server-side view/generate distance set to 2 chunks, I never see any trees just popping into existence on already-generated terrain. Also I somehow managed to make snow appear under AND on top of trees in snow biomes. Pretty much all the issues you mentioned don't seem to actually happen using my exact code.
PS: what you said about large structures being able to generate from any section at any time, This cannot be true, as a structure is saved as a single data file in the world, with a single x,z coordinate location, and will only generate the structure itself when that data file exists, which is generated along with the chunk that its x & z center coords lie in. I actually have seen large structures just pop into existence in vanilla.
PPS: if viewing a world in MCEdit, you can sometimes see 1-chunk-thick border with no decorations, so some part of this half-chunk-offset thing does actually leave some kind of border, I guess it isn't perfect though.

(at) Conor
Of course the @ does not do anything here, I'm merely following what others do, for whatever reasons they use it 😛 (I actually do not use any web-thingy where @ would be any kind of tag. Or any thingy which would use #. Oh wait, Yammer at work, uses both iirc, ...)
Anyway, caves are indeed generated chunk by chunk. I was describing what could happen if the idea you have was extended to handle larger things (like caves, if they were actually generated as one large thing at once). Any really good idea should be extendable like that, I merely pointed out how it doesn't (or well, does, but with bad resource needs). (I also did mention that as a compromise, your idea at the scale you mentioned does work just fine, and since Minecraft is already full of compromises, lots of bad ones too, your one should fit in just fine.)
Snow both under and top of trees is likely the side-effect of the half-chunk shift, but I have no idea how, as so far, looking at maps, it seems that ground snow is also placed later (it has the same half-chunk shift and delay).
PS: The large structures at anytime - It sure is true, I just checked some old map of mine, which had a suspicious looking village at the edge of generated area. I loaded the world, traveled to that village, and looked the map again. Now it had the full village. It actually had been partially generated so that even some of the houses were cut. (This same partial generation of villages has, at times, caused funny stacked half-houses -effects, leaking farms, etc., due to other bugs messing things up.)
Hmm.. there is a chance that I had already traveled far enough to reach that "center" point and thus the necessary data to generate its structures existed already. I couldn't find a map with only a smaller corner of village waiting, and no time to specifically test with new world now.
In any case, the game can generate villages chunk by chunk, though it could start with a larger part.
PPS: the border with no decoration/snow/etc. is actually half a chunk wide. I have looked at that part of the code quite a few times as part of trying to resolve multiple bugs, but I still can't get my head quite around that thing.
Any chance someone can link me to an unobfuscated chunk-by-chunk cave generator? I want to use it for something, all I have at the moment is something which generates caves as whole objects.

Conor McS:
Linking to a ready unobfuscated MC code (even a large snippet like that) would likely be a copyright violation. Well, not the linking itself I guess, but anyway, better not to support such activities. However, Mojang currently seems to give somewhat "ok" if you do it yourself with "MCP" from your own legally acquired copy of the game files.
At least the last time that I looked at that code, it didn't create the caves chunk-by-chunk. It always created any and all whole caves that possibly could touch the chunk being created. (Partially the reason for its "heaviness"). Edit: the whole caves are not created/generated, per se, when just doing one chunk, but the algorithm may end up going through their full span in order to find out whether it touches the chunk or not.
Also, a comment in an unrelated JIRA issue (this issue is about badly generated surface features) might not be the best place to ask for even non-MC-originated version of such generator.. You should probably take a look at a suitable section in some forums instead, your request would be seen probably by about 1000 times more people...
In Superflat worlds, this incorrect placement seems to depend on the order in which structure types are specified. For seed -7993066103807340761 the following preset generates grass on the gravel roads (otherwise impossible) in the village around -468, 64, 194 given the following preset:
3;1*minecraft:bedrock,59*minecraft:stone,2*minecraft:dirt,1*minecraft:grass;1;decoration,village,mineshaft(chance=0.01),stronghold(chance=32 count=3 spread=3),biome_1(distance=32),dungeon,lake,lava_lake
The impossible grass persists until the gravel is dug up or a redstone block (even a lamp with no inputs) is placed nearby. The following preset generates the same village, but with the grass already uprooted (and, accordingly, with extra dropped seeds sitting on the roads):
3;1*minecraft:bedrock,59*minecraft:stone,2*minecraft:dirt,1*minecraft:grass;1;village,mineshaft(chance=0.01),stronghold(chance=32 count=3 spread=3),biome_1(distance=32),dungeon,decoration,lake,lava_lake
This glitch is a rare glitch in Minecraft 1.8+
I just found this glitch in the new snapshot 15w31c in a village
Confirmed in 16w39b
Confirmed in 16w39c
Confirmed in 16w40a
Confirmed in 16w41a
Confirmed in 16w42a
Confirmed in 16w43a
Confirmed in 16w44a
No need to update postponed tickets, as a fix won't be attempted any time soon.
Confirmed in major release 1.11
Let's just agree to disagree with Mojang 🙂. They clearly stated these kind of quirks are a signature feature of the game's engine; see one of the earlier comments.
Can someone please close this bugreport?

This ticket was reopened and assigned to @unknown, which means that the developers (at least one of them) think that this bug needs to be fixed. This ticket won't be closed unless the issue gets fixed or the devs say to do so.

found tree generated on patch of sand in pre 10

I don't know if this is a known part of the bug, or another bug, but I've found multiple cases of grass growing directly on top of other grass.
(The screenshot I've just uploaded has an example of this, along with other floating grass, and also includes both the seed and coords)
This seems to happen quite frequently with water ponds in savanna biomes.
Confirmed for 1.13.1.
Confirmed for 1.13.2-pre2.
Confirmed for 19w04b
Confirmed for 19w07a
flower right next to spawn seed is: 6331652741370124972
Also confirmed for build 19w09a. Map seed -882114519412305203
[media]Minecraft 19w11b
[media][media]
Still in 19w13b and 19w14a

Still in 19w14b and 1.14 Pre-Release 1

Still in 1.14 Pre-Release 2

Still in 1.14 pre-3, 1.14 pre-4 and 1.14 pre-5
Confirmed still in 1.14 release.
(edit: changed inline image to external link for readability)
https://i.imgur.com/uQbrR8S.png

Still in 1.14.1 Release
can reproduce in 1.14 and 1.14.1
Can reproduce in 1.14.2 Pre-Release 1

Still in 1.14.2 Pre-Release 2

Still active in pre-release 2 of 1.14.3
Still in 1.14.3
Still in 1.14.3.
It's not just a cosmetic issue. I fell through a patch of floating snow into a lava lake while carrying two large, filled out maps. I was not happy.

Question: I am not watching this bug report but keep getting email notifications for this bug. How can I turn this off?

Still exists in 19w34a
1.14.4 the grass also spawns inside houses in villages
Emily, that seems to be another issue which is tracked in MC-140727.

Confirmed in 19w45b.
As you can see:
[media]bug is still not fixed.
This is very important in fact, because such "floating" layer of snow can be above the lava lake, unfortunately I felt that sorrowful moment on myself, falling through transparent snow into the lava and died, lost all good stuff.
Found my last year world and re-created it:
[media]Oh and seed -294883631847010 XYZ: 642 / 67 / 744
While quirks can be interesting, this one is just ugly... not to mention dangerous in the case of floating snow over lava - a jarring reminder this bug is more than annoying. It'd be really nice to see this fixed when it comes to grass, snow, etc.
Seed -4983198545228022230
Right by spawn
This still happens in 1.15.1
[media]Still happening in 20w10a
Confirmed in 20w16a. Grass can even spawn on path blocks
How is it possible that such a simple bug has lasted so long?
Comfirmed in 1.15.2,20w20a,20w20b,20w21a.
I can't believe that it takes so long for Mojang to not fix this bug. Bug is so annoying and visually easy to spot and i don't understand why they avoid to fix it.
Bamboo and ferns also work

Affects 1.16
Still affects 1.16.1
[media]
Don't think we need any more screenshots?

Mojang Priority is important (but secretly l o w)
Maybe they will fix that in 1.17? Because the Mountain Update is coming, they will partly change the generation

Worldgen has been (semi-)overhauled many times since 1.4. I'm not sure why this bug is Important, it's a bit of a quirk, doesn't affect any gameplay. I'm assuming that they'd like to fix this (at least to free up some time for the mods marking duplicates) but the risk / chance of a fix causing more bugs is probably not worth it.
@unknown, that is not quite true. I've seen deaths by lava because of this bug (snow in the air that didn't melt yet).
Grass can also replace parts of trees.
I think that this has even caused hardcore deaths just because the snow doesn't has melted yet
I'm not a MC dev, but a fix should just require checking for grass or snow above air blocks. I expect this would add some small load during chunk generation, but it isn't the same as a fix for suspended sand/gravel (which IMHO would be recursive in nature). Not that the latter is the same kind of problem, but it's another example of generate-then-sweep behavior.
this also occurs on seed -4977636324086404853 at 49, 71, -79, on 1.16.3

Please use the subreddit for discussion.
Please don't attach any more screenshots to this ticket. Thank you.
And was already said, if you want to discuss this issue please do so on /r/Mojira, not in this comment section.
Can confirm in 20w48a.
This can happen with amethyst geodes as well.
Can confirm in 20w49a.

As I said a year and a half ago, how do I turn off email notifs for this when I'm not even watching it?

Nixinova, if you have (or don't mind to get) an access to Discord, the official help channel for this "Mojira" is there: https://discord.gg/rpCyfKV
Might also manage to work it out via https://www.reddit.com/r/Mojira
I.e. try and get some mods to get some Mojira admin (probably Mojang staff) to check things out. Perhaps there is some glitch going on or some deeply buried setting or whatnot.
@unknown, try watching the bug report and unwatching it again, I assume this is a JIRA bug. If that doesn't solve your issue, please contact me via Discord.
This happens to me if plant generates on sand and gravel and other block that generates in-natural.
Also the plants and grasses are floating on air
This affects other latest snapshot, if it could be fixed above the future.

Also in 51a.
21w03a.
@unknown: please stop posting unhelpful comment.
Can confirm in 21w05a.
Can confirm in 21w05b.
Can confirm in 21w08a
Also not only gravel and sand patch generation is affected by this, also structures like villages can let grass generate in locations it shouldn't
Can confirm in 21w08b.
Acacia villages have this EVERYWHERE! mostly just grass in the houses and floating water in the farms.
As of 21w10a, this happens with cave vines too.
[media]
If the snow generates floating it may even prevent you from noticing that the lake is there. Here is another example:
Seed: 3722430670368519204
Coordinates: /execute in minecraft:overworld run tp @s -8505.59 75.28 -914.79 2.19 53.24
Can confirm in 21w13a.
This happens because terrain features such as lake_lava
, lake_water
, disk_gravel
, disk_clay
and disk_sand
are applied after features such as trees and grass, causing them to appear in incorrect places. Fixing this would be fairly trivial, by making such features that change the terrain be applied before features that simply add things.
Can confirm in 21w14a.
Can confirm in 21w15a.
I created a collection issue in MC-223305 with ways to fix several world generation bugs, including this one.
Can confirm in 21w16a.

In 21w17a

Can confirm for 21w17a
lol, bug since 1.4.2 and still not fixed.

In 21w18a

This has now been fixed for everything except trees. For any remaining or reintroduced issues, please open new and specific reports with new repro steps.
No joke, i have been waiting this bug to be fixed for years. Well done guys.
LET'S GOOOOO, this is one of the two bugs that I've always wanted fixed the most in the entire game, this is literally a dream come true for me, thanks so much slicedlime!
Oh my god they actually fixed it. I never thought I'd see the day.
Please keep this issue free of any additional comment. 🙂
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki
do we open up a new issue for the tree thing then?
as it wasn't fixed actually, it may be reopened, however the fix works... But not always
Please open a new issue with reproduction steps for any case which does not seem fixed. We will link the new ticket to this issue. 😉
Not properly fixed. I assume this means the "fix" made the symptoms 99% less common, but new tickets have been opened for supposedly fixed aspects of this bug:
MC-225843 (snow layers over lakes and lava)
MC-225842 (Flowers over lakes)
MC-225850 (Grass, tall grass, flower, double flower, fern, large fern, and tree can generate on sand or gravel)
Haven't found the new ticket for the trees though.
I'm just working off the "bug reports new as of 21w20a" page:
https://www.reddit.com/r/Mojira/comments/ngaymy/bugtracker_report_21w20a/

@unknown The tree one is MC-225839 it is marked with 1.16.5 since it wasn't actually fixed with this report so you won't find it in the reddit report

Does that appear on the same seed in an unmodified client (no Optifine)?
Edit: If so, you might be experiencing MC-140727.
为什么1.16后草有时能浮空的bug又重新存在了呢?
Why can grass sometimes float after 1.16? Why does bug reappear?
Because it was fixed after 1.18 go to later versions.

i have seen this before in 1.19.2
For any future or present worldgen issues similar to this, please create a new bug report if none exists yet.

Relates to MC-280100