Affects Version/s: 1.17 Pre-release 3
Fix Version/s: None
A bit of background:
Custom dimensions can be defined by adding a file to a datapack with the path
Within this file are two keys "type" and "generator".
The "type" key defines the height of the world along with some other data.
There are two ways of defining this key.
One way is to define it as a compound tag which simply contains the data.
The second (and I believe preferred way) is to define this as a resource identifier which refers to another file at the path
which contains the previously mentioned compound tag.
The issue is that the contents of the first file are embedded in the level.dat file exactly as it was defined.
For the first case outlined above this is perfectly fine. The level.dat file contains all the required information for the dimension to exist. If the data pack is deleted the level is still accessible.
In the second case the height settings are not embedded in the level.dat file. I assume the game has to load them from the data pack each time. If the data pack is deleted in this case the game does not have enough information to fully define the dimension and the player gets kicked back to the overworld and the custom dimension is inaccessible.
The solution to this is if "type" is a resource identifier, load the dimension_type data from the file and embed it in the level.dat file instead of the original resource identifier.
level.dat file snippet created with the first method (compound)
The level.dat file created with the second method (resource identifier)