Fog is the haze that hides the edge of the world and turns everything blue underwater. A fog file in the resource pack sets its color and how close it starts. You can then use it in a biome, or give it to a player with a command.
In this page you will make a warm pink ruby fog for the Ruby Grove biome.
The files
RP/
fogs/
ruby_fog.json
biomes/
ruby_grove.client_biome.jsonThe fog file
{
"format_version": "1.21.90",
"minecraft:fog_settings": {
"description": {
"identifier": "wiki:ruby_fog"
},
"distance": {
"air": {
"fog_start": 0.6,
"fog_end": 1.0,
"fog_color": "#e8a0a8",
"render_distance_type": "render"
},
"water": {
"fog_start": 0,
"fog_end": 40,
"fog_color": "#8a2e4a",
"render_distance_type": "fixed"
},
"weather": {
"fog_start": 0.2,
"fog_end": 0.6,
"fog_color": "#7a5a60",
"render_distance_type": "render"
}
}
}
}The identifier needs a namespace. One fog per file.
Where the fog applies
Inside distance, each key is a situation. You only need to list the ones you want to change.
| Key | Used when |
|---|---|
air | Normal play, out in the open. |
weather | It is raining or snowing. |
water | Your head is underwater. |
lava | Your head is in lava. |
lava_resistance | In lava with Fire Resistance. |
powder_snow | Stuck inside powder snow. |
The fields
| Field | What it does |
|---|---|
fog_color | The fog color, as a hex string like "#e8a0a8". |
fog_start | Where the fog begins. |
fog_end | Where the fog is fully thick and you cannot see past it. |
render_distance_type | How to read the two numbers above. See below. |
transition_fog | Optional. Makes the fog fade in over time, like when you first dive into water. |
render_distance_type changes what fog_start and fog_end mean:
"render": the numbers are a share of the player's render distance.0.6means 60 percent of the way out. Good forair, so it works with any render distance setting."fixed": the numbers are in blocks.40means 40 blocks away. Good for underwater, where you want the same look for everyone.
Thick, spooky fog
Use "fixed" with small numbers, like fog_start 2 and fog_end 24, for a swamp or haunted biome where you can barely see.
Fading fog with transition_fog
Vanilla water uses this so your view clears up slowly after you dive in:
"transition_fog": {
"init_fog": {
"fog_start": 0,
"fog_end": 0.01,
"fog_color": "#8a2e4a",
"render_distance_type": "fixed"
},
"min_percent": 0.25,
"mid_seconds": 5,
"mid_percent": 0.6,
"max_seconds": 30
}init_fog is the fog right when you enter. Then it moves toward the normal settings: min_percent of the way at the start, mid_percent after mid_seconds, and all the way after max_seconds.
Volumetric fog
With Vibrant Visuals turned on, fog can also be a real 3D haze that light shines through. Add a volumetric block next to distance:
"volumetric": {
"density": {
"air": {
"max_density": 0.08,
"max_density_height": 64,
"zero_density_height": 120
}
},
"media_coefficients": {
"air": {
"scattering": [0.05, 0.03, 0.03],
"absorption": [0.0, 0.0, 0.0]
}
},
"henyey_greenstein_g": {
"air": {
"henyey_greenstein_g": 0.6
}
}
}| Field | What it does |
|---|---|
max_density | How thick the haze gets at its thickest. Vanilla biomes use small values, around 0.05. |
max_density_height | The height (Y) where it is thickest. |
zero_density_height | The height where it fades to nothing. Set it above max_density_height for ground fog. |
scattering | How much red, green and blue light bounces off the haze. Higher red makes a warm glow. |
absorption | How much red, green and blue light the haze swallows. |
henyey_greenstein_g | Light direction, from -1 to 1. Near 1, the haze glows brightly when you look toward the sun. |
Players without Vibrant Visuals only see the distance fog, so always set that too.
Using your fog
In a biome
Point the client biome at it with minecraft:fog_appearance:
"minecraft:fog_appearance": {
"fog_identifier": "wiki:ruby_fog"
}You can also give a vanilla biome new fog this way. Make a client biome file with the vanilla identifier, like minecraft:plains.
Near the edge of two biomes, the game blends their fogs together, so the change is smooth.
With a command
/fog puts a fog on top of everything else for chosen players, and it stays after the world reloads:
/fog @a push wiki:ruby_fog ruby_event
/fog @a pop ruby_eventThe last word is a name you make up. pop takes off the newest fog with that name, remove takes off every fog with that name.
How the game picks a setting
Fog works in layers. For each setting, the game checks from the top layer down and uses the first one that has it:
- Fogs added with
/fog(newest first). - The fog of the biomes around the player.
- The default fog.
- Built-in values, if nothing else sets it.
So a /fog file that only sets water keeps the biome's air fog.
Fog not changing?
Check that fog_identifier matches the identifier in your fog file exactly, namespace included. Then check the file is in RP/fogs/ and that the resource pack is on in the world.