mojira.dev

TelepathicGrunt

Assigned

No issues.

Comments

After digging through the code some more, the issue appears to be that the CARVERS and FEATURES ChunkStatus are set to FINAL_HEIGHTMAPS EnumSet to specify what heightmaps to update for that status and also to persists to disk for the chunk if the chunk unloads and read from the chunk later.

However, if the chunk never unloads, the chunk will continue to hold the WORLD_SURFACE_WG heightmap in memory (frozen in state because it does not get updated anymore due to not being in the chunkstatus’s EnumSet anymore) and the entirety of Feature and Structure generation is relying on this undefined behavior.

Thus when the CARVERS ChunkStatus chunk unloads, the WORLD_SURFACE_WG heightmap is erased from memory and not saved to disk either. Thus when chunk is loaded again, the heightmap snapping code defaults to the non-worldgen heightmaps that were previously being updated to include features and structure block placements. Which then causes Village roads on tree.

Yep, worldgen is literally built upon non-persistent worldgen heightmap memory state. A possible fix could be to make SerializableChunkData save and read all available heightmaps present if the chunk is not a FULL ChunkStatus chunk.

Datapack to use and photo of issue. Had to made it separate due to Jira not working properly with initial submission

[media: heightmap_bug.png]
[media]

To reproduce, put game into hard mode and creative. Set time to night. Then run this command:

/scoreboard objectives add dummyobjective dummy

Now run this command so we can see when a leader zombie is found

/scoreboard objectives setdisplay sidebar dummyobjective

Fly around the world at night, running this command every so often:

/execute as @e[type=zombie] store success score @s dummyobjective run attribute @s spawn_reinforcements modifier value get minecraft:leader_zombie_bonus

When a UUID shows with a score of 1, you found a leader zombie. Run the data get command on the UUID shown and you can see the zombie has the health boost attribute but their health value is still at 20 instead of the new max health.

/data get entity <UUID>

[media: image-20251201-174119.png]


Can confirm the issue still persists in 1.21.10