So far I have only gotten this to happen with igloos, but I have not tested all of the structures so there may be more. To reproduce:
Load up a new world in single player with cheats enabled and the attached datapack. It will give you an advancement whenever you enter an igloo.
Use /locate to find an igloo and enter it. You should get the advancement as normal.
Exit the igloo and save and quit.
Reload the world. Use /advancement to revoke the igloo advancement (will be named "test:igloo_enter")
Enter the igloo again. You will not receive the advancement this time. Instead, change your gamemode to Creative and fly to Y=90, with the igloo X and Z coordinates. Once you go to Y=90, the advancement should be granted like it did before.
I'm not sure if the Y=90 bounding box shift happens for other structures that may have this bug (if any). Attached are screenshots showing the advancement being given before the reload and then at Y=90 after the reload.
Attachments
Comments 2
Looking at IglooPieces.IglooPiece#postProcess
in both 1.20.1 and 1.21, the template position handling feels wrong, but I can't say whether it's actually the cause:this.templatePosition
is being saved to a local variable, then adjusted with a vertical offset, then super.postProcess
is called, and at the end of the method this.templatePosition
is reset to the original value.
As far as I can tell, there only seem to be two other structure piece types (ocean ruin and shipwreck) that modify this.templatePosition
within their postProcess
method, but they both do that only before the super.postProcess
call and without resetting it again afterwards. Maybe that reset causes the structure information to be serialized with the wrong Y value after placing the blocks.
Can confirm in 23w42a.