Repository navigation
Fog
satisfy edited this page Oct 21, 2026
·
1 revision
Shared terrain fog for all mods. Every mod registers a source, Foundation picks the densest active fog and blends it in and out smoothly. Several mods with fog (snow, mist, swamps …) never overwrite each other.
BiomeFog.register(MyMod.identifier("mist"), (level, cameraPos, renderDistance) -> {
if (!MyConfig.mistFog() || !level.getBiome(cameraPos).is(MyBiomes.MISTY_FOREST)) {
return null;
}
return new BiomeFog.Fog(renderDistance * 0.1F, renderDistance * 0.5F);
});- Return
nullfor "no fog right now", or aBiomeFog.Fog(start, end)with distances in blocks. - Called once per client tick.
renderDistanceis the current render distance in blocks, handy for percentages. - The same id again replaces the source.
- Of all active sources the one with the smallest
endwins. - Fog fades in and out over about 3 seconds; when the target changes, start and end follow smoothly.
- Fog never gets thinner than vanilla's: Foundation only lowers start and end.
- Only terrain fog; under water, in lava or in powder snow vanilla fog stays.
- Your config switch belongs in the source: return
nullwhen it is off.