I believe the root cause of this is the use of tagged choice / tagged union types for block entity IDs. This is acceptable for vanilla because it has a fixed, hard-coded list of IDs, but it is woefully inadequate for mods (regardless of modding platform) because it requires knowing all block entity ids before datafixers are compiled.
I believe the issue manifests when a TileEntity with a non-vanilla ID is included in the list. Because in Schema2842
the DataFixer only reads types of DSL.list(TypeReferences.BLOCK_ENTITY.in(schema))
and the non-vanilla ID isn't considered a "BLOCK_ENTITY
" so the type doesn't match. This deletes the data instead of throwing an error because the field is marked as optional.
I can reproduce the issue with a single region file:
[media]. Add this region to a world and run `/execute in minecraft:overworld run tp @s -1533.11 71.00 -133.02 236.73 11.40` to go to the location.
I just encountered the same issue. Loading a copy of the world in 1.17.1 locally works, but loading another copy of the world in 1.18.1 locally breaks.
I've tried these steps:
Load original 1.17 world on 1.18 server, join, chests are empty.
Load original 1.17 world on 1.17 client, open, chests are full.
Load original 1.17 world on 1.18 client, open, chests are empty.
Load original 1.17 world on 1.17 client, open, observe chests, save and quit, open in 1.18 client, chests are empty.
Additionally, it appears that all Block Entities are removed since signs, hoppers, etc. are also blank where there are empty chests.
This issue is related to MC-241670