interface GenerateTerrainOptions {
    baseHeight?: number;
    generateBlobs?: boolean;
    generateOres?: boolean;
    generatorType?: "nether" | "end" | "normal" | "fractal";
    getBlockTypeFunction?: GenerateTerrainGetBlockTypeFunction;
    heightVariation?: number;
    lavaLevel?: number | false;
    minMSBetweenTickWaits?: number;
    netherAirThresholdFunc?: (
        value: number,
        pos: Vector3,
        noise: {
            noise2D: NoiseFunction2D;
            noise3D: NoiseFunction3D;
            noise4D: NoiseFunction4D;
        },
        offset: Vector3,
        scale: Vector3,
    ) => boolean;
    noise?: {
        noise2D: NoiseFunction2D;
        noise3D: NoiseFunction3D;
        noise4D: NoiseFunction4D;
    };
    offset?: Partial<Vector3>;
    oreGenerationMode?: "v1" | "v2";
    orePalette?: OreTypes;
    oreTypes?: OreTypes;
    scale?: Partial<Vector3>;
    waterLevel?: number | false;
}

Properties

baseHeight?: number

The height variation to use for the terrain.

biomeToDefaultTerrainDetailsMap[biome]["baseHeight"] ?? 63
generateBlobs?: boolean

Whether or not to generate blobs.

Only applies if GenerateTerrainOptions.oreTypes is not specified.

false
generateOres?: boolean

Whether or not to generate ores.

Only applies if GenerateTerrainOptions.oreTypes is not specified.

false
generatorType?: "nether" | "end" | "normal" | "fractal"

The generator type to use for the terrain of the biome type.

Generator Types:

  • normal - Regular overworld generation. The generates with everything below the surface being solid, and the surface having height variation, including mountains.
  • nether - Nether generation. This generates similarly to the nether.
  • end - End generation. This generated end islands.
biomeToDefaultTerrainDetailsMap[biome]["generatorType"] ?? "normal"

A function to use for getting the block type for the terrain generation, this will override the biome-specific terrain.

The coordinates of the block that the block type is being retrieved for.

The maximum height of the terrain and the block's x and z coordinates.

The base height of the terrain.

The biome the block is being generated in.

The noise functions.

The noise value used to determine the localMaxHeight value.

The block type to generate.

getBlockTypeV2
heightVariation?: number

The height variation to use for the terrain.

biomeToDefaultTerrainDetailsMap[biome]["heightVariation"] ?? 10
lavaLevel?: number | false

The lava level to use for the terrain.

If set to false, no lava will be generated.

biomeToDefaultTerrainDetailsMap[biome]["lavaLevel"] ?? false
minMSBetweenTickWaits?: number

Minimum amount of time in milliseconds to spend regenrating the blocks each tick.

config.system.defaultMinMSBetweenTickWaits
netherAirThresholdFunc?: (
    value: number,
    pos: Vector3,
    noise: {
        noise2D: NoiseFunction2D;
        noise3D: NoiseFunction3D;
        noise4D: NoiseFunction4D;
    },
    offset: Vector3,
    scale: Vector3,
) => boolean

The nether air threshold function to use for the terrain of the biome type.

Should be a function that returns true if the block should be generated and false otherwise.

Type declaration

    • (
          value: number,
          pos: Vector3,
          noise: {
              noise2D: NoiseFunction2D;
              noise3D: NoiseFunction3D;
              noise4D: NoiseFunction4D;
          },
          offset: Vector3,
          scale: Vector3,
      ): boolean
    • Parameters

      • value: number

        The noise value. It is a float from -1 to 1 (inclusive).

      • pos: Vector3

        The position where the block is to be generated. It is a Vector3 object.

      • noise: { noise2D: NoiseFunction2D; noise3D: NoiseFunction3D; noise4D: NoiseFunction4D }

        An object containing the 2D, 3D, and 4D noise functions.

      • offset: Vector3

        The offset used to generate the noise value.

      • scale: Vector3

        The scale used to generate the noise value.

      Returns boolean

      True if the block should be generated, false otherwise.

(value: number) => value > 0
noise?: {
    noise2D: NoiseFunction2D;
    noise3D: NoiseFunction3D;
    noise4D: NoiseFunction4D;
}

The noise functions to use.

If not specified, it will generate it based off of the seed.

getNoise(seed)
offset?: Partial<Vector3>

The offset to use for the noise functions.

The actual block positions will not be offset, instead it will offset the coordinates passed into the noise functions.

{x: 0, y: 0, z: 0}
oreGenerationMode?: "v1" | "v2"

The ore generation mode to use.

v1 is more cubic.

v2 is more elliptic.

orePalette?: OreTypes

The types of ores and blobs to generate.

Unlike GenerateTerrainOptions.oreTypes, this will be evaluated and filtered based on the biome and other settings.

Only applied if GenerateTerrainOptions.oreTypes is not specified.

(oreTypes as OreTypesType).filter(
(blockTypeData) =>
(blockTypeData.biomes === "All" ||
("not" in blockTypeData.biomes ? !blockTypeData.biomes.not.includes(biome) : blockTypeData.biomes.includes(biome))) && includedOreFeatureCategories[blockTypeData.oreFeatureCategory]
)
oreTypes?: OreTypes

The types of ores and blobs to generate.

This will override any biome-specific ore configurations, the generateOres option, and the generateBlobs option.

To presere these settings use orePalette instead.

scale?: Partial<Vector3>

The scale to use for the noise functions.

The actual block positions will not be scaled, instead it will scale the coordinates passed into the noise functions.

{x: 0, y: 0, z: 0}
waterLevel?: number | false

The water level to use for the terrain.

If set to false, no water will be generated.

biomeToDefaultTerrainDetailsMap[biome]["waterLevel"] ?? false