Skip to content

Features and Carvers 1.18

Chris edited this page Apr 4, 2022 · 2 revisions

With the update to 1.18, many of Minecraft's features are data-driven. This means that their properties and functionality are determined by data you can edit. This includes biomes and their generators, dimensions, loot tables, and more. Consequently, BiomeTweaker enables you to create and add data-defined features and carvers to biomes. This page will describe how this is done.

Existing Features and Carvers

If you wish to simply reproduce a carver or feature that already exists (such as adding canyons or ores to more biomes), you don't need to do anything extra. Simple use the addCarver or addFeature command and pass it the resource location of the existing carvers or features.

New Carvers

First, we must establish the difference between a world carver and a configured carver. A configured carver is a world carver with configuration options. Configured carvers are what end up actually modifying the world. BiomeTweaker lets you add new configured carvers by changing the configured. BiomeTweaker does not let you add new world carvers.

World Carver -> Configured Carver

To start adding a configured carver, you must be aware of the configured carvers input folder config/biometweaker/carvers/. This is where you will create the json files that specify your carvers. Equally important is the configured carvers output folder config/biometweaker/output/carver where BiomeTweaker will dump information about all existing configured carvers when you run the output command. In the input folder, you must create json files that specify a configured carver according to the rules defined here. The output folder is important, because if your goal is to make a small modification to an existing configured carver (such as making caves more common), you can simply copy and paste the configured carver json from the output folder and make your modification. For example, in the output folder you will find minecraft_cave.json shown here. A few important to things to note:

  • The first thing you will see is the registry name. This is the resource location you use to refer to this configured carver.
  • Second is the configured_carver which shows all the configuration in the carver. Most importantly is the type field at the bottom of this section. You will note that it says "minecraft:cave". This is the world carver that the configured carver uses as it's backbone. When making a new configured carver, you must use an existing world carver as the type. You will see all of the types of world carvers by looking through the configured carver type output .

Say we want a carver that makes caves very common. Taking the existing cave configuration, we can copy and paste the configured_carver section into a new file config/biometweaker/carvers/too_many_caves.json shown here. Note that I have only copied over the data inside the configured_carver section. I have also modified the probability field (line 37) from 0.15 to 0.9 that gives a cave a 90% chance of starting in a chunk. To use this carver in a script, you must first register it. The file alone does nothing, and only after registering it will Minecraft be aware of its existence:

Tweaker.registerCarver("too_many_caves")

This will look for the file config/biometweaker/carvers/too_many_caves.json and register the configured carver under the resource location biometweaker:too_many_caves. To add this carver to a biome, you now simply use the addCarver command.

New Features

Adding features is very similar to carvers, but there is an additional step. When dealing with features, we have features, configured features, and placed features. Features are the backbone that determine how the configured feature behaves. Correspondingly, a configured feature is a feature with configuration options. Finally a placed feature is a configured feature with additional information about how the feature should be placed in the world. BiomeTweaker allows you to add new configured and placed features.

Feature -> Configured Feature -> Placed Feature

The input folder for configured features is config/biometweaker/features/config/ and for placed features is config/biometweaker/features/. You will find analogous output folders where you can see details about all known configured and placed features. The strategy is then the same as making new carvers. Say we want to make ancient debris spawn in the overworld. The first step is to take the output file config/biometweaker/output/feature/config/minecraft_ore_ancient_debris_large.json shown here and copy the relevant data to a new input file config/biometweaker/features/config/ancient_debris_huge.json. You can name the input file whatever you want, as long as you are consistent. We then modify the file as shown here. Note that we have only copied the data inside the configured_feature section and I have modified the size to 10, air exposure discard change to 0, and changed the target tag to overworld stone. Note the type field says minecraft:scattered_ore, which is the feature this configured feature is using.

We must now tell Minecraft how to place this configured feature, so we copy the output file config/biometweaker/output/feature/minecraft_ore_ancient_debris_large.json shown here shown here and to a new input file config/biometweaker/features/netherite_common.json and modify it as shown here. Note that I have changed the the feature field to biometweaker:ancient_debris_huge which corresponds to the configured feature file we made earlier (note the name is the same as the file, but prefixed with biometweaker). I have also changed the placement properties to more closely resemble those you might see from ores like coal in the output files (but with a huge count to make the ore very likely to spawn).

Finally, we can register our new placed feature. We do this by calling

Tweaker.registerFeature("netherite_common")

This will look for the file config/biometweaker/features/netherite_common.json and register it as biometweaker:netherite_common which you can use in the addFeature command. You might then ask what about the configured feature this placed feature refers to? This happens under the hood, but BiomeTweaker will see that you are using biometweaker:ancient_debris_huge as the configured feature and, if not already registered, look for the file config/biometweaker/features/config/ancient_debris_huge.json and register it as biometweaker:ancient_debris_huge. This is a configured feature however, and cannot be used in the addFeature command. You can reuse it in as many placed features as you want however.

TLDR (and Minecraft Wiki)

  • Place configured carver files in config/biometweaker/carvers/ and register them with Tweaker.registerCarver.
  • Place configured feature files in config/biometweaker/features/config/.
  • Place placed feature files in config/biometweaker/features/ and register them with Tweaker.registerFeature.

You can also add features and carvers through data packs. The Minecraft wiki is your friend and contains info on the specification of these json files for both BiomeTweaker and data packs. See the following links:

https://minecraft.fandom.com/wiki/Custom_world_generation

https://minecraft.fandom.com/wiki/Custom_world_generation/carver

https://minecraft.fandom.com/wiki/Configured_feature

https://minecraft.fandom.com/wiki/Placed_feature

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