FOGS DOCUMENTATION Version: 1.21.50.7
索引
返回顶部
迷雾定义
迷雾在 resource_packs,/'name of pack'/,fogs 目录下的 Json 文件中设置。迷雾架构
迷雾 JSON 架构
```--------{ 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 current biome. { object "init_fog" // Initial fog that will slowly transition into water distance fog of the biome when 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 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 takes to complete fog transition. } } object "weather" : opt // The fog settings for when the camera is in the air with active weather (rain, snow, etc..). { 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 current biome. { object "init_fog" // Initial fog that will slowly transition into water distance fog of the biome when 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 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 takes to complete fog transition. } } object "water" : opt // The fog settings when the camera is in 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. object "transition_fog" : opt // Additional fog data which will slowly transition to the distance fog of current biome. { object "init_fog" // Initial fog that will slowly transition into water distance fog of the biome when 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 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 takes to complete fog transition. } } object "lava" : opt // The fog settings when the camera is in lava. { 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 current biome. { object "init_fog" // Initial fog that will slowly transition into water distance fog of the biome when 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 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 takes to complete fog transition. } } object "lava_resistance" : opt // The fog settings when the camera is in lava and the player has the lava resistance effect active. { 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 current biome. { object "init_fog" // Initial fog that will slowly transition into water distance fog of the biome when 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 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 takes to complete fog transition. } } object "powder_snow" : opt // The fog settings when the camera is inside a Powder Snow block. { 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 current biome. { object "init_fog" // Initial fog that will slowly transition into water distance fog of the biome when 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 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 takes to complete fog transition. } } } object "volumetric" : opt // The volumetric fog settings. { object "density" : opt // The density settings for different camera locations. { object "air" : opt // Fog density values as light passes through air blocks. { float "max_density"<0.000000-1.000000> // The maximum amount of opaqueness that the ground fog will take on. A value from [0.0, 1.0]. float "max_density_height"<-64.000000-320.000000> : opt // The height in blocks that the ground fog will become it's maximum density. float "zero_density_height"<-64.000000-320.000000> : opt // The height in blocks that the ground fog will be completely transparent and begin to appear. This value needs to be at least 1 higher than 'max_density_height'. bool "uniform" : opt // When set to true, the density will be uniform across all heights. } object "weather" : opt // Fog density values as light passes through air blocks with active weather (rain, snow, etc..). { float "max_density"<0.000000-1.000000> // The maximum amount of opaqueness that the ground fog will take on. A value from [0.0, 1.0]. float "max_density_height"<-64.000000-320.000000> : opt // The height in blocks that the ground fog will become it's maximum density. float "zero_density_height"<-64.000000-320.000000> : opt // The height in blocks that the ground fog will be completely transparent and begin to appear. This value needs to be at least 1 higher than 'max_density_height'. bool "uniform" : opt // When set to true, the density will be uniform across all heights. } object "water" : opt // Fog density values as light passes through water blocks. { float "max_density"<0.000000-1.000000> // The maximum amount of opaqueness that the ground fog will take on. A value from [0.0, 1.0]. float "max_density_height"<-64.000000-320.000000> : opt // The height in blocks that the ground fog will become it's maximum density. float "zero_density_height"<-64.000000-320.000000> : opt // The height in blocks that the ground fog will be completely transparent and begin to appear. This value needs to be at least 1 higher than 'max_density_height'. bool "uniform" : opt // When set to true, the density will be uniform across all heights. } object "lava" : opt // Fog density values as light passes through lava blocks. { float "max_density"<0.000000-1.000000> // The maximum amount of opaqueness that the ground fog will take on. A value from [0.0, 1.0]. float "max_density_height"<-64.000000-320.000000> : opt // The height in blocks that the ground fog will become it's maximum density. float "zero_density_height"<-64.000000-320.000000> : opt // The height in blocks that the ground fog will be completely transparent and begin to appear. This value needs to be at least 1 higher than 'max_density_height'. bool "uniform" : opt // When set to true, the density will be uniform across all heights. } object "lava_resistance" : opt // Fog density values as light passes through lava blocks while the player has lava resistance. { float "max_density"<0.000000-1.000000> // The maximum amount of opaqueness that the ground fog will take on. A value from [0.0, 1.0]. float "max_density_height"<-64.000000-320.000000> : opt // The height in blocks that the ground fog will become it's maximum density. float "zero_density_height"<-64.000000-320.000000> : opt // The height in blocks that the ground fog will be completely transparent and begin to appear. This value needs to be at least 1 higher than 'max_density_height'. bool "uniform" : opt // When set to true, the density will be uniform across all heights. } } object "media_coefficients" : opt // The coefficient settings for the volumetric fog in different blocks. { object "air" : opt // Fog coefficient values while light passes through air. { color "scattering" // Proportion of light that is scattered per block. color "absorption" // Proportion of light that is absorbed (lost) per block. } object "water" : opt // Fog coefficient values while light passes through water. { color "scattering" // Proportion of light that is scattered per block. color "absorption" // Proportion of light that is absorbed (lost) per block. } object "cloud" : opt // Fog coefficient values while light passes through clouds. { color "scattering" // Proportion of light that is scattered per block. color "absorption" // Proportion of light that is absorbed (lost) per block. } } } }}----------```返回顶部
活动迷雾堆栈
活动迷雾堆栈
活动迷雾堆栈用于确定在游戏中的任何给定时间使用哪个 fog 设置。每个玩家都有一个独特的雾堆栈。每当游戏需要确定雾的值时,它将从雾堆栈的顶部开始,然后向下检查,直到找到当前设置类型的值。因此,如果堆栈上的 fog 设置没有它正在寻找的设置,那么它将继续在堆栈中向下并签入。如果找不到此类设置,它将改用引擎定义的默认值。雾堆栈的初始设置如下。从底部开始:- Engine Default:硬编码值。- Data Default: 默认的数据驱动设置。- Biomes: 定义为在每个生物群系上的设置。- Command: 服务器命令在玩家上设置的设置。生物群系
生物群系
生物群系图层是玩家位置周围生物群系定义的所有设置的平均值。生物群系设置也以 “biomes_client.json” 为单位为每个单独的生物群系定义。返回顶部
命令
命令
命令层是由 “/fog” 命令设置的所有设置,并将其从上到下评估为一个堆栈。更多细节请参见 “Fog Command” 部分。返回顶部
数据默认值
数据默认值
如果它通过 “fog_identifier” 引用雾定义,则在 “default” 下的 “biomes_client.json” 中定义。返回顶部
引擎默认值
引擎默认值
硬编码值(如果没有数据驱动值);堆栈的隐式底部。返回顶部
生物群系
生物群系
可以使用 “biomes_client.json” 确定生物群系的迷雾设置。在每个生物群系条目中,您可以有一个名为 “fog_identifier” 的变量,并设置一个与您要用于此生物群系的雾设置相匹配的名称。“default” 条目也可以通过这种方式设置,并将在活动雾堆栈中的生物群系条目下使用。因此,生物群系的雾设置并不会完全替换默认设置,而是在默认设置之上读取生物群系,如 “Active Fog Stack” 部分所述。“default”生物群系条目有标签 “remove_all_prior_fog”,默认为 “false”。当设置为 false 时(或未输入标签),缺少的迷雾定义将由任何填充了定义的较低资源包填充。当设置为 true 时,将清除资源包中启用它的当前包之前的所有先前迷雾定义,从而有效地使当前资源包成为所有迷雾的新起点。在每个生物群系(包括“default”)中,都有标签“inherit_from_prior_fog”,也默认为“false”。当设置为 false 时(或未输入标签),当前资源包的生物群系将用自己的标签覆盖当前存储的 “fog_identifier” 标签。当设置为 true 时,来自所有匹配生物群系的 “fog_identifier” 标签将被添加在一起,并为该生物群系创建一个新的合并迷雾定义。返回顶部
Fog Command
Fog命令
“/fog” 可用于管理每个玩家的活动迷雾堆栈的这一层中的迷雾设置。该层中的迷雾设置通过下面描述的 “/fog” 命令的 “push”、“pop” 和 “remove” 模式进行排序。迷雾设置会在活动雾堆栈中从上到下进行评估,其中首先包括本层中从上到下的雾化设置此图层中的迷雾设置将保存,然后在每个玩家的世界加载时恢复。这样,在世界保存之前推送的迷雾设置在世界加载之后仍将应用,然后可以压入。Pop
压入
从所选玩家中删除与用户提供的 ID 匹配的最顶层迷雾设置(即之前通过“/fog push”命令提供)。返回顶部
Push
弹出
将新的迷雾设置连同用户提供的 ID 一起推送到玩家的活动迷雾堆栈的 Fog Command 层的顶部。返回顶部
Remove
移除
从所选玩家中删除与用户提供的 ID 匹配的所有匹配迷雾设置(即之前通过一个或多个“/fog push”命令提供的 ID)。返回顶部