Feature Request - 1.18.2 Forge
Tyrius1 opened this issue ยท 5 comments
Blacklists would be easier when considering just vanilla but in the instance where you have 3 or 4 different mods adding new biomes a Whitelist becomes vastly more comfortable.
You could auto generate biomes into the field as well and have people just remove the ones they don't want.
Ultimately I think Whitelist will be easier in the long run. Especially if you can auto fill existing biomes like Better Animals Plus does.
In the source code, I can see the spawn is biome-based rather than world-based, which means the whitelist/blacklist is going to be biome-based. The nether and the end have their own biomes. I guess modded dimensions do something similar.
Up to 1.18.1, there was a BiomeCategory
enum used to distinguish between biome types. But since 1.18.2, that enum became deprecated and was succeeded by "Biome Tags". You can find the vanilla tags in net.minecraft.world.level.biome.Biomes
and net.minecraft.tags.BiomeTags
. Custom and modded biomes also have their own tags.
My proposed solution is to have both a whitelist and a blacklist. In short words, a creature can only spawn in a certain biome if it passes the whitelist and is not blocked by the blacklist. The whitelist will be evaluated first. By default, it only contains one rule that matches everything. Of course, you can modify the rules to match your need. If a spawn item matches any rule in the whitelist, it will be passed to the blacklist for examination. Otherwise, it will be discarded by the whitelist, and the corresponding creature will not spawn. The blacklist works similarly. If a spawn item matches any rule in the blacklist, it will be discarded.
The whitelist/blacklist (json-based) may look like this:
{
whitelist: [
{
{mob: "*", "biome": "*"}
}
],
blacklist: [
{
{mob: "archer", "biome": "nether_wastes"},
{mob: "archer", "biome": "the_end"}
}
]
}
See also:
https://gist.github.com/TelepathicGrunt/b768ce904baa4598b21c3ca42f137f23
https://minecraft.fandom.com/wiki/Biome/JSON_format
Since 1.19, adding mob spawns in Forge is now data-driven. See: https://github.com/rikka0w0/MobZReborn/tree/main/src/generated/resources/data/mobz/forge/biome_modifier
I'm trying to bring the same feature to the Fabric version, it will parse the same set of Forge-only JSONs and let Fabric API understand them. For 1.18.2 and below, there should be some administrative mod that let you modify mob spawns. Due to my limited available time, I won't be able to bring this feature to 1.18.2 and below. However, PRs are always welcomed.
Do you want to have a look at this mod:
https://www.curseforge.com/minecraft/mc-mods/in-control