Minecraft defines many datatype codecs through RegistryFileCodec
, which allows elements to be inlined rather than defined by their key.
This is improperly used for Biome
s, which causes cases where inlined (not registered) Biome
s are passed around in the world.
For example, the data pack below generates a world with an inlined biome.
This causes many issues, as HashMapPalette
expects each instance to be registered by a registry, and due to it being inlined, it returns an invalid value.
Impact:
This also causes many issues due to the fact that these biomes are not synchronized with the client.
In general, there are many uses where inlining is truly useful... especially in cases where it does not depend on synchronization here.
The proper solution would be to most likely not allow inlining biomes via their Codec
, or for allowInlineDefinitions
to be false.
How to reproduce
Create a new world and add the attached data pack
Notice that the data pack validates fine and the world starts generating
After spawning in, run:
/execute in machine_maker:world run tp @s ~ ~ ~
❌ The game softlocks as the chunks fail to load in and lots of errors are logged.
Confirmed in 1.20.2, also affects the LIST_CODEC that uses
RegistryCodecs.homogeneousList
instead ofRegistryFileCodec
.