mojira.dev
MC-299348

World fails to load after removing datapack containing custom dimension

Summary

When a world contains a datapack that adds a custom dimension, removing the datapack afterwards causes the world to fail loading with an error. The world should be able to load normally even after datapack removal.

It's really quite annoying, I've had quite a few players come up to me with the problem. And they're stuck playing with datapacks forever.

Steps to Reproduce:

  1. Create a new world in version 1.21.7 with a datapack that adds a simple custom dimension

  2. Launch and enter the world successfully

  3. Disconnect from the world

  4. Remove the datapack from the world's datapacks folder

  5. Attempt to reload the world

  6. Observe that the world fails to load

Expected Result:

The world should load normally, ignoring the missing dimension.

Actual Result:

The world fails to load completely.

Root Cause Analysis:

Minecraft appears to search for the dimension key via the level.dat file and cannot find it, consequently preventing world launch. The issue occurs in the WorldGenSettings > dimensions > foo:bar path in level.dat.

Screenshots and the test datapack are attached to demonstrate the issue.

Proposed Solution:

When a resource location for a dimension is missing during world loading, the corresponding entry in level.dat should be automatically removed. If the player later re-adds the datapack, this would have no negative impact as the dimension field would be regenerated.

Since this involves constant information only, removing it should be safe.

Environment

  • Minecraft Version: 1.21.7

  • World with custom datapack dimension

  • Windows 11

Linked issues

Attachments

Comments 1

Can confirm, but this is invalid per this comment.

Hardel

(Unassigned)

Confirmed

(Unassigned)

1.21.7

Retrieved