mojira.dev
MC-216411

Strongholds not respecting biome's structure entries in worldgen datapacks

I created a stronghold_test_gen.json datapack which removes the stronghold from all biomes except for Mushroom Fields biome. The expected behavior is that Strongholds will generate only in Mushroom Fields. However, when using the attached stronghold_test_gen.json datapack, /locate points and shows generated strongholds that are nowhere close to Mushroom Fields biomes. Doing /locatebiome showed the closest one was over 2000 blocks away.

The issue seems to be caused by the Stronghold placement code not actually checking if the biome at the spot is a valid biome that the stronghold can spawn in. For a more intuitive behavior that users can understand, it probably should be best that Strongholds adds a check to make sure the biome it saves that spawn position in is also in a biome that has the stronghold added to it.

Do note however that beaches, swamp, oceans, and river biomes do not have the stronghold start saved in them by default so by fixing this bug, it could cause old stronghold locations to no longer spawn if the start position was in a beach, swamp, ocean, or river.

Linked issues

Attachments

Comments 3

@unknown, can this still be reproduced in 1.18-pre5 or later?

We will need to wait until a future minecraft version. As of 1.18-pre5, Mojang removed the structure section from Biome json so it is currently impossible to change what biomes a structure spawns in by datapack. This is part of Mojang's refactoring of structures. Once they add back the ability to do custom structures and change where structures spawn, then we can test to see if the issue still persist. 

Structures now have biome tags for what biome they can spawn in. Is this still an issue for you in 22w07a?

TelepathicGrunt

(Unassigned)

Unconfirmed

(Unassigned)

1.16.5, 1.17

Retrieved