Overlay biome mob spawns

- 26.3 custom biomes write natural_mob_spawns as an overlay modifier with its argument, matching vanilla biomes
- NeoForge biome modifiers can add spawns to Iris biomes again
- The 26.3 custom biome codec test checks the overlay modifier
This commit is contained in:
Brian Neumann-Fopiano committed 2026-09-29 03:56:40 -04:00
1 parent 6fd877ebfc
commit 5e95248057
2 files changed
+8 -2

No files matched your search

@@ -34,9 +34,12 @@ public final class DataFixerV263 extends DataFixerV1217 {
.put("max_inclusive", maximum));
}
}
// Vanilla writes spawns as an overlay. A bare value decodes as an override, which NeoForge biome modifiers refuse to edit.
attributes.put("minecraft:gameplay/natural_mob_spawns", new JSONObject()
.put("spawns_by_category", spawners)
.put("spawn_costs", fixed.getJSONObject("spawn_costs")));
.put("argument", new JSONObject()
.put("spawns_by_category", spawners)
.put("spawn_costs", fixed.getJSONObject("spawn_costs")))
.put("modifier", "overlay"));
Object probability = fixed.remove("creature_spawn_probability");
if (probability != null) {
attributes.put("minecraft:gameplay/creature_world_gen_spawn_probability", probability);