Opened an existing world in 1.21.10.22. Switched to creative. Traveled to my guardian farm. Killed existing guardians using kill command. Moved to AFK position but guardians failed to spawn. Switched from hard mode to peaceful and back again. Verified that Mob spawning is turned on.
Step to Recreate
1) Download Derptopia Season 2 world at https://silentwisperer.com/5405-0 and open in 1.20.80
Alternate https://silentwisperer.com/downloads/
2) TP to 1413 61 -815
3) Kill existing mobs using kill @e[family=monster]
4) Move around platform and confirm that guardians are spawning back in.
Open the same world in 1.21.10.22. Repeat the steps above. Note that the guardians are no longer spawning.
Expected behavior: Guardians should be spawning. This problem is being reported with other structure related mob spawns.
Linked issues
relates to 2
Attachments
Comments 3

The bug can be reproduced on a fresh world in 1.21.10.22. It isn't related to whether the world is upgraded or not. The game will create structure spawning areas (hard coded spawning areas) in fresh chunks, but it doesn't seem to save them or load them from existing chunks. This is very bad because once the hardcoded spawning areas are lost, structure spawning will also be permanently lost from those chunks.
Steps to Reproduce
Create a new world with seed 1.
TP to 3200 100 1800 and you will find a SwampHut there.
Tear down the roof and wall of the hut and build a platform to cover the entire chunk.
Kill all monsters `/kill @e[family=monster]`
Watch witches spawn near the center of the SwampHut
Restart the game. Kill all monsters again. Witches no longer spawn as they did before.
The Cause
I inspected the world save using rbedrock and determined that the information for hardcoded spawning areas (chunk data with tag 57) isn't being saved in the world db. The information also does not appear to be moved to another location in the world db. Therefore it appears that the LevelChunk class has a regression that dropped support for saving and loading hardcoded spawning areas.