mojira.dev
MC-308004

Overriding overworld dimension (world preset) with custom dimension implementation crashes the game on second world load

Overriding the overworld dimension (world preset) with a custom dimension implementation crashes the game on the second world load.

This only happens if enough biome parameter points are defined in the dimension JSON. Making a custom dimension that is identical to the overworld and that overrides the overworld dimension causes this, as too many data points are written to NBT, and NBT is then too large. Same datapack (with appropriate changes of course) loaded on 1.21.1 (same number of biome parameter points) loads.

Looking at the game source, this is because in 1.21.x, LevelStorageSource used 104857600 bytes for the NbtAccounter limit, while in 26.1.2, NbtAccounter uses the default limit (defaultQuota), which is only 2097152 bytes, which is not enough to load such a world save.

I would consider this a regression, as loading the world made in 1.21.1 that used so many data points, the world loaded, but if one now opens such a world in 26.1.2, the game will fail to load the world, which makes existing saves with a custom data pack that has enough biomes not usable on 26.1.x.

I am attaching both 1.21.1 and 26.1.2 data packs for testing, and the crash log in 26.1.2.

Steps to reproduce:

CASE A

  1. Load 26.2.2 data pack and create a world with it

  2. Save the world

  3. Open it again

  4. The game will crash at this point as it will fail to deserialize level NBT due to a too-small limit

Snippet of crash log:

Failed to load level data or datapacks, can't proceed with server load
java.util.concurrent.ExecutionException: net.minecraft.nbt.NbtAccounterException: Tried to read NBT tag that was too big; tried to allocate: 2097150 + 28 bytes where max allowed: 2097152
	at java.base/java.util.concurrent.CompletableFuture.wrapInExecutionException(CompletableFuture.java:345)
	at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:440)
	at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2094)
	at net.minecraft.client.gui.screens.worldselection.WorldOpenFlows.loadWorldDataBlocking(WorldOpenFlows.java:212)
	at net.minecraft.client.gui.screens.worldselection.WorldOpenFlows.loadWorldStem(WorldOpenFlows.java:154)
	at net.minecraft.client.gui.screens.worldselection.WorldOpenFlows.openWorldLoadLevelStem(WorldOpenFlows.java:424)
	at net.minecraft.client.gui.screens.worldselection.WorldOpenFlows.lambda$upgradeAndOpenWorld$2(WorldOpenFlows.java:379)
	at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:173)
	at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:23)
	at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:147)
	at net.minecraft.util.thread.BlockableEventLoop.runAllTasks(BlockableEventLoop.java:127)
	at net.minecraft.client.Minecraft.runTick(Minecraft.java:1345)
	at net.minecraft.client.Minecraft.run(Minecraft.java:991)
	at net.minecraft.client.main.Main.main(Main.java:248)
Caused by: net.minecraft.nbt.NbtAccounterException: Tried to read NBT tag that was too big; tried to allocate: 2097150 + 28 bytes where max allowed: 2097152

CASE B (migration of old save)

  1. Load 1.21.1 data pack and create a world with it

  2. Save the world

  3. Open it again

  4. Save the world

  5. Remove data pack

  6. Update the game to 26.1.2

  7. Open the same save, can be without a datapack if desired

  8. A crash will happen

Linked issues

Attachments

Comments 3

Thank you for helping us improve Minecraft! We saved your files:

[media][media][media]

The root problem is that old save loading allowed larger NBT data (100 MB) than new one (2 MB), so existing saves can fail to load but worked perfectly in old game versions, rendering such saves non-updatable

Thank you for your report!
We're tracking this issue in MC-307144, so this ticket is being resolved and linked as a duplicate.

That ticket has already been resolved as Fixed. Please check the Fix Version/s field in that ticket to see in which version this behavior was or will be fixed.

If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki

klemendev

(Unassigned)

Unconfirmed

26.1.2

Retrieved