Chunks don't load correctly after large TNT explosions
Linked Issues
Created Issue:
Chunk loading still broken in 1.15 pre-1
Using this command: "/fill ~ ~ ~ ~50 ~50 ~5" tnt I blew up a lot of TNT, and while doing so, chunk loading broke. At one point I could see no blocks at all.
Environment
Windows 10, look in the screenshot.
Windows 10, look in the screenshot.
Chunkloading still broken in 1.15 pre-1Chunks sometimes still don't load correctly after large TNT explosions
Using this command: "/fill ~ ~ ~ ~50 ~50 ~5" tnt I blew up a lot of TNT, and while doing so, chunk loading broke. At one point I could see no blocks at all.
testing discovered
Chunkssometimes stilldon't load correctly after large TNT explosions
The bug
After a large TNT explosion, it seems like the lighting is not immediately updated.
Probably Won't Fix as the server is overloaded and doesn't have time to compute all the lighting.
To reproduce
See MC-166055.
I would like to bump this again because I am finding a pattern and probable cause for its occurrence, as well as evidence for linkage to another significant bug.
I've done extensive testing for hours trying different things, and it actually started with bug MC-166005 - "Stuttering when crossing chunk borders/loading chunks", in which I discovered that villages in 21w16a with the Caves & Cliffs datapack, created enormous lag spikes in the region, up to 30 chunks away from the village boundary. It turns out that in the same lag spike region, the dark/missing chunk issues were often found. I would repeat it over and over-- fly to a new village, fly around it a bit, and I would get both lag spikes, and dark chunks. Repeat with a new village. While I found that severe lag spikes were unique to having the Caves & Cliffs datapack running, the dark chunks are still repeatable under the same circumstances even in prior versions before datapack usage, i.e. 21w14a.
There are 2 good ways to predictably reproduce the dark/missing chunks, and anticipate where they will occur. Start in spectator, and go full speed with the mouse wheel + sprinting in either case.
- Villages - Fly to a village and past it along an axis, X or Z. The fly-through generates the village and surrounding chunks in an easier straight-line pattern. Keep flying away to completely unload the village and surrounding area (I go 1000 blocks away). Turn around and fly back to the village. There will be a chance the dark chunks will appear near the village, usually arranged in lines, if you flew along an axis. If the village has a certain size bounding box surrounding it, the dark chunks will usually be straight lines on the perimeter of a larger box around the village.
- Teleportation - Teleport to a completely new area away from any already generated chunks (I suggest doing nicer numbers like 2000, 2000 so its easy to remember and stay aligned with). Immediately upon teleporting, fly around in a spiral (increasingly larger radius circle) surrounding your teleportation location in such a way to create as many chunks as quick as possible for up to a minute or so. Align yourself with the teleportation location, and fly directly along the X or Z axis far enough away to completely unload the area (i.e. 1000 blocks), and return. Check the area surrounding your teleportation location. You can try different things each time you teleport to a new location to see different patterns of dark chunks. While the shapes can vary, you can still find straight line and 'corner' shaped dark chunks.
In either case, here is what I think is happening:
- During chunk generation, the game is demanding a certain amount of resources which can't be met as quickly for whatever the reason is, so let's say we call this "stress". Based on my findings in bug MC-166055, villages are somehow creating more stress (especially in the C&C datapack to the point of severe lag spikes), so the likelyhood of finding dark chunks around it are higher. Creating lots of new chunks generally creates more stress, but especially teleporting to a new area that's surrounded by completely ungenerated terrain and flying around-- more chunks have to be generated around the player rapidly, so it's more likely to find dark chunks. In both cases, revisiting terrain you generated under high-stress conditions, more likely gives dark chunks where it had issues generating. The dark chunks usually seem to take a shape based on the way you stress-loaded the generation.
Here's a few examples to illustrate what commonly happens in each method:
Case 1 Examples: Dark chunk line perpendicular to village line of sight


Case 2 Examples: Dark chunk "box" surrounding a teleportation location & Other irregular shapes



I'm heavily inclined to believe that the dark/missing chunk issues are caused by anything that causes excess stress during the chunk generation process, and some chunk data is getting at least temporarily corrupted. Example: the game is generating a chunk, something interrupts the process, causing data to be incomplete. Let's say we roll with that idea. Sky lighting maybe doesn't get the chance to have data populated in the sub-chunk, so the default value is 0 (dark) unless otherwise given the opportunity to be filled with a "15". As some have noticed, the dark chunks can also coincide with trees being chopped at the boundary, which seems like it would be consistent with chunk generation being interrupted as well. Maybe there's other generation features that can be interrupted too. They seem like different issues at face value, but might have the same root cause.
note: On a server, some dark chunks will disappear after relogging, some won't. For the ones that won't disappear, even completely shutting down the server and restarting it multiple times won't fix it, and remain 'permanently' mob-spawnable.
And maybe the reason why it's more difficult to reproduce this issue with the non-C&C generation, is because it's harder to achieve the amount of stress needed to start corrupting chunk data-- less chunk height means less to generate, and a smaller window of opportunity for something to interrupt the chunk generation process? So something would need to be optimized/fixed with chunk generation so that it's much harder or impossible to interrupt chunk data creation? And something about villages would need to be potentially optimized?
Just my thoughts based on the patterns I've observed, hope this helps!


Can confirm; with that large of a TNT explosion I think it's just the server being overloaded. There's just so much you can do about that.
Confirmed in 1.16-pre2. Since the ticket is a little bit outdated, I would like to be the reporter of it - I'll update it accordingly.
Can confirm in 20w51a.
Can confirm in 1.17.1.
over time, the chunks will load