Skip to content

Example Scripts 1.18

Chris edited this page Apr 4, 2022 · 3 revisions

Radioactive Plains

This is a somewhat contrived example to show off the various features in BiomeTweaker. Say we wanted to make the plains look "radioactive". This would affect the various colors in the biomes, say turning the sky and water red, the leaves blue, and the grass yellow. The fog in the distance looks green due to he residual radioactivity. Additionally, a lot more caves have formed and some of the stone has turned into ancient debris! Furthermore, the nuclear fallout has made it very cold and it now snows in the plains.

To begin, create a blank script file config/biometweaker/scripts/radioactive_plains.cfg. We can then create the object representing the plains biome in our script:

plains = forBiomes("minecraft:plains")

Now, we set the various colors and temperature using the set command:

plains.set("precipitation", "snow") #Make it snow if cold enough
plains.set("waterColor", 0xFF0000) #red water
plains.set("skyColor", 0xFF0000) #red sky
plains.set("fogColor", 0x00FF00) #green fog
plains.set("grassColor", 0xFFFF00) #yellow grass
plains.set("foliageColor", 0x0000FF) #blue foliage (leaves)
plains.set("temperature", 0) #cold temperature

To make caves more common, we first remove the existing caves:

plains.removeCarver("AIR", "minecraft:cave")
plains.removeCarver("AIR", "minecraft:cave_extra_underground")

You can find these entries in the output file for the plains biome so you know what to remove. We then need to add caves back in, but more commonly. Following the carver specification, we create a carver json file config/biometweaker/carvers/too_many_caves.cfg given here and register and add it to our plains biomes:

Tweaker.registerCarver("too_many_caves")
plains.addCarver("AIR", "biometweaker:too_many_caves")

Finally, we need to make ancient debris generate in stone. We can do this by making a custom ore as described in the feature documentation. The configured feature config/biometweaker/feature/config/ancient_debris_huge.json and placed feature config/biometweaker/feature/netherite_common.json are given here and were created by modifying existing ore features from the output files. We then register them and add them to the biome:

Tweaker.registerFeature("netherite_common")
plains.addFeature("UNDERGROUND_ORES", "biometweaker:netherite_common")

The full script is

plains = forBiomes("minecraft:plains")

plains.set("precipitation", "snow")
plains.set("waterColor", 0xFF0000)
plains.set("skyColor", 0xFF0000)
plains.set("fogColor", 0x00FF00)
plains.set("grassColor", 0xFFFF00)
plains.set("foliageColor", 0x0000FF)
plains.set("temperature", 0)

plains.removeCarver("AIR", "minecraft:cave")
plains.removeCarver("AIR", "minecraft:cave_extra_underground")
Tweaker.registerCarver("too_many_caves")
plains.addCarver("AIR", "biometweaker:too_many_caves")

Tweaker.registerFeature("netherite_common")
plains.addFeature("UNDERGROUND_ORES", "biometweaker:netherite_common")

The result is as desired; you can see the colors are as we have set them, there are multiple cave openings in view with ancient debris spawning in them. 2022-04-04_01 34 12

BiomeTweaker has been updated to 1.18. Please see the links below. Pages for previous versions can be found above.


BiomeTweaker 1.18

Features and Carvers

Custom Mob Effects

Example Scripts

Clone this wiki locally