Biome Effect Modifiers - MehVahdJukaar/polytone GitHub Wiki

Biome Effect Modifiers

Biome Effect Modifiers feature allows you to tweak all the rendering parameters of a biome using a Resource Pack (client sided) insteaed of a Data Pack like its usually done.

These include:

  • Water Color
  • Fog Color
  • Water Fog Color
  • Sky Color
  • Foliage Color Override
  • Grass Color Override
  • Ambient Particle
  • Music
  • Biome Sounds

Note

Some information on the examples in this page is only relevant for older minecraft versions, thing such as sky_color, fog_color and more are done in 1.21.11 with the use of the attribute_modifiers block. Check out its wiki page.

Getting Started

The file will have to be in assets/[biome namespace]/polytone/biome_modifiers/[biome path].json.

For example if you want to modify quark:glimmering_weald you can do so with a file located in assets/quark/polytone/biome_modifiers/glimmering_weald.json

Explicit targeting

Alternatively, if you want to manually specify your targets you can place this json in assets/[your pack namespace]/polytone/biome_modifiers/[some name].json (Any path will work but this is recommended to avoid overwriting Implicit defined targets).

Then you can add the targets field to the json containing a list of valid Biome ids as follows:

{
   "targets": ["minecraft:stony_beach", "minecraft:beach"]
}

Json Example

Here is an example of how the .json could look (using implicit target mode. Json at assets/minecraft/polytone/biome_modifiers/forest.json, thus targeting forest).

{
   "fog_color": 2324,
   "water_fog_color": 0,
   "sky_color": 33,
   "particle": {
      "options": {
         "type": "minecraft:poof"
      },
      "probability": 0.2
    }
}

Note that all fields are optional.

Vanilla Resources

There are many more parameters you can add here, however this file serializes exactly the same as a vanilla BiomeSpecialEffect object found in any biome definition.

As such you can find more info on the Official Minecraft Wiki

You can also use Misode Datapack Generator to create the content of this file. Note that we only care about the "Effects" sub section and copy paste it in the json directly (without the key "effects")

https://misode.github.io/worldgen/biome/ (be sure to select the correct MC version)

For redundancy here is an image showing the revelant section on Misode website as well as the output json you can copy.

image

image

Fog Shape

(1.21.5 or less)

Additionall thise json element can contain 2 more fields that can control the shape of fog in a particular biome.These are:

fog_fade and fog_radius

  • fog_radius: How far away the fog will be.
  • fog_fade: This controls how harsh the transition from no fog to foggy will be. set to 0 for no transition, 1 for default one.

Both are Multipliers for the game current fog radius and fade values. Set to 1 to have no effect.

(in previous versions these were called fog_end and fog_start)

like this:

{
  "fog_radius": 0.5,
  "fog_fade": 0.9
}

Alternatively, if you want more control for things such as making fog Weather or Day Time dependent you can use an MathExpression (check out Scripting section), as follows: In this example fog end will decrease when weather is rainy

{
  "fog_radius": "1 - RAIN"
}

Attributes Modifiers

(1.21.11+ only)

Environment Attribute modifiers are a very powerful concept explained in detail in the Environment Attributes Wiki page.

These will allow you to edit a miriad of game parameters like fog, sun, stars, sky, cloud and much more in a modular and per biome fashion.

To do so you'll have to follow the instructions on the before mentioned page and add it to the attributes_modifiers field in your Biome Modifier json.

Here is an example of how to modify the fog color and fog start in 1.21.11. More on its wiki page.

{
  "attributes_modifiers": {
    "base": {
       "minecraft:visual/fog_color": 2324,
       "minecraft:visual/fog_start_distance": {
         "argument": 0.2,
         "modifier": "multiply"
       }
    }
  }
}