FOGS DOCUMENTATION Version: 1.21.60.24
This is documentation for a preview release of Minecraft. New features, components, and capabilities in this release are not final and might change without notice before the final release.
Be sure to check the documentation once the release is out of preview if your add-on isn't working properly. Resource and Behavior Packs created for the preview are not guaranteed to work on the final release.
Index
Back to top
Fog Definitions
Fogs are setup in Json files under the resource_packs, /'name of pack'/, fogs directory.Fog Schema
Fog JSON Schema
--------
{
"version": "format_version",
"object": "minecraft:fog_settings",
{
"object": "description",
{
"string": "identifier" // The identifier for these fog settings. The identifier must include a namespace.
},
"object": "distance" : opt // The distance fog settings for different camera locations.
{
"object": "air" : opt // The fog settings when the camera is in the air.
{
"color": "fog_color", // The color that the fog will take on.
"float": "fog_start", // The distance from the player that the fog will begin to appear. 'fog_start' must be less than or equal to 'fog_end'.
"float": "fog_end" <0.000000-*>, // The distance from the player that the fog will become fully opaque. 'fog_end' must be greater than or equal to 'fog_start'.
"string": "render_distance_type" <"fixed", "render">, // Determines how distance value is used. Fixed distance is measured in blocks. Dynamic distance is multiplied by the current render distance.
"object": "transition_fog" : opt // Additional fog data which will slowly transition to the distance fog of the current biome.
{
"object": "init_fog", // Initial fog that will slowly transition into water distance fog of the biome when the player goes into water.
{
"color": "fog_color", // The color that the fog will take on.
"float": "fog_start", // The distance from the player that the fog will begin to appear. 'fog_start' must be less than or equal to 'fog_end'.
"float": "fog_end" <0.000000-*>, // The distance from the player that the fog will become fully opaque. 'fog_end' must be greater than or equal to 'fog_start'.
"string": "render_distance_type" <"fixed", "render">, // Determines how distance value is used. Fixed distance is measured in blocks. Dynamic distance is multiplied by the current render distance.
},
"float": "min_percent" <0.000000-1.000000>, // The minimum progress of fog transition.
"float": "mid_seconds" <0.000000-*>, // The time it takes to reach certain progress ('mid_percent') of fog transition.
"float": "mid_percent" <0.000000-1.000000>, // The progress of fog transition after 'mid_seconds' seconds.
"float": "max_seconds" <0.000000-*>, // Total amount of time it takes to complete fog transition.
}
}
}
}
}
--------
Active Fog Stack
Active Fog Stack
The active fog stack is used to determine which fog setting to use at any given time in the game. Each player has a unique fog stack.Whenever the game needs to determine the values for the fog, it will start at the top of the fog stack and check down it until it has found a value for the current setting type. So, if a fog setting on the stack does not not have the setting it's looking for, then it will continue down the stack and check in. If it finds no such setting, it will instead use the defaults defined by the engine.The fog stack initially is setup as follows. Starting at the bottom:- Engine Default: hard code values.- Data Default: The default data driven settings.- Biomes: The settings defined to be on each biome.- Command: The settings set on the player by server commands.Biomes
Biomes
The biome layer is an average of all the settings defined by the biomes around the player's position. The biome settings are defined in "biomes_client.json" as well for each individual biome.Back to top
Command
Command
The command layer is all the settings set by the "/fog" command and evaluated it as one stack from top to bottom. More detail in the "Fog Command" section.Back to top
Data Default
Data Default
Defined in "biomes_client.json" under "default" if it references a fog definition via "fog_identifier".Back to top
Engine Default
Engine Default
Hard coded values in case there are no data driven values; the implicit bottom of the stack.Back to top
Biomes
Biomes
Fog settings can be determined for the biomes with "biomes_client.json". In each biome entry, you can have a variable called "fog_identifier" and set a name that matches the fog setting you want to use with this biome.The "default" entry can also be set this way and will be used underneath the biomes entries in the active fog stack.So, a biome's fog setting does not completely replace the default's setting, but instead the biome is read on top of the default as described in the "Active Fog Stack" section.The "default" biome entry has the tag "remove_all_prior_fog" that is defaulted to "false".While set to false (or if the tag is not entered), missing fog definitions will be filled in by any lower resource pack that does have the definition filled.When set to true, all previous fog definitions in resource packs before the current pack that enabled it will be cleared, effectively making the current resource pack the new starting point for all fogs.In each biome (including "default") there is the tag "inherit_from_prior_fog" that is also defaulted to "false".While set to false (or if the tag is not entered), the current resource pack's biome will overwrite the currently stored "fog_identifier" tag with its own.When set to true, the "fog_identifier" tags from all matching biomes will be added together and create a new merged fog definition for that biome.Back to top
Fog Command
Fog Command
"/fog" can be used to manage fog settings in this layer of the active fog stack for each player.Fog settings in this layer are ordered via the "push", "pop", "remove" modes of the "/fog" command described below.Fog Settings are evaluated top-to bottom in the active fog stack which includes top-to-bottom in this layer first.Fog settings in this layer are saved and then restored on world load per player. In this way a fog setting that is pushed before a world save, will still apply after a world load and can then be popped.Pop
Pop
Removes the top-most fog setting, from selected player(s), that matches the user provided ID (i.e. as provided previously via a "/fog push" command).Back to top
Push
Push
Pushes a new fog setting, to specified player(s), along with a user provided ID, onto the top of the Fog Command layers of the players' active fog stacks.Back to top
Remove
Remove
Removes all matching fog settings, from the selected player(s), that matches the user-provided ID (i.e. as provided previously via one or more "/fog push" commands).Back to top