World Presets, Chunk Generators, & Dimension Types

World Preset

World presets determine the dimensions of a world by mapping a the id of the dimension to its dimension type and chunk generator. WorldJS adds the ability to create world presets through KubeJS’s ServerEvents.registry('worldgen/world_preset', event => {}) event via the default (no type id) builder

  • : Adds a dimension to the preset
    • id: ResourceKey<LevelStem>: The id of the dimension
    • dimensionType: Holder$Reference<Dimensiontype>: The id of the dimension type to use for the dimension
    • generatorType: ResourceLocation: The id of a chunk generator builder type
    • generatorBuilder: Consumer<ChunkGeneratorBuilder>: A callback to edit the properties of the chunk generator builder
      • The methods available will depend on the generatorType
    • Note: A minecraft:overworld dimension must be set for the preset to be valid
  • : Add the preset to the minecraft:normal tag so it can be selected in the create world screen
  • : Add the preset to the minecraft:extended tag so it is available in the create world screen as a hidden preset
  • : Makes this preset be selected by default in the create world screen

Example

ServerEvents.registry('worldgen/world_preset', event => {
    event.create('cave_world')
        .withDimension(
            'minecraft:overworld',
            'minecraft:overworld_caves',
            'minecraft:noise',
            generator => generator
                .noiseSettings('minecraft:caves')
                .biomeSource(
                    'minecraft:multi_noise',
                    biomeSource => biomeSource
                        .usingParameters(climate => {
                            climate.forBiome('minecraft:plains')
                                .depth(0, 2)
                                .continentalness(0, 2)
                                .erosion(1.5, 2)
                                .humidity(-1, 1)
                                .temperature(1, 2)
                                .weirdness(-2, 2)
                            climate.forBiome('minecraft:ice_spikes')
                                .depth(0, 2)
                                .continentalness(-1 , 2)
                                .erosion(-2, 2)
                                .humidity(-1, 2)
                                .temperature(-2, 1)
                                .weirdness(-2, 0)
                            climate.forBiome('minecraft:flower_forest')
                                .depth(-2, 1)
                                .continentalness(-0.5, 2)
                                .erosion(-2, 2)
                                .humidity(-2, 2)
                                .temperature(-1, 1)
                                .weirdness(-1, 0)
                            climate.forBiome('minecraft:cold_ocean')
                                .depth(-2, 0.25)
                                .continentalness(-2, 0.1)
                                .erosion(-2, 2)
                                .humidity(-2, 2)
                                .temperature(-2, -1)
                                .weirdness(-2, 2)
                            climate.forBiome('minecraft:ocean')
                                .depth(-2, 0.4)
                                .continentalness(-2, 0.1)
                                .erosion(-2, 2)
                                .humidity(-2, 2)
                                .temperature(-1, 2)
                                .weirdness(-2, 2)
                            climate.forBiome('minecraft:lush_caves')
                                .depth(-2, 2)
                                .continentalness(-1, 1)
                                .erosion(0, 2)
                                .humidity(0, 2)
                                .temperature(0.5, 2)
                                .weirdness(0, 2)
                            climate.forBiome('minecraft:deep_dark')
                                .depth(-2, -1.75)
                                .continentalness(1.5, 2)
                                .erosion(-0.1, 0.1)
                                .humidity(1, 2)
                                .temperature(1, 2)
                                .weirdness(1, 2)
                            climate.forBiome('minecraft:deep_dark')
                                .depth(-2, -1.75)
                                .continentalness(1.75, 2)
                                .erosion(0.1, 0.2)
                                .humidity(1.5, 2)
                                .temperature(1.5, 2)
                                .weirdness(0.5, 1)
                            climate.forBiome('minecraft:badlands')
                                .depth(-2, 2)
                                .continentalness(-2, 2)
                                .erosion(-2, 2)
                                .humidity(-2, 2)
                                .temperature(-2, 2)
                                .weirdness(-2, 2)
                                .offset(1)
                        })
                )
        )
        .withDimension(
            'minecraft:the_nether',
            'minecraft:the_nether',
            'minecraft:noise',
            generator => generator
                .noiseSettings('minecraft:nether')
                .biomeSource(
                    'minecraft:fixed',
                    biomeSource => biomeSource
                        .biome('minecraft:nether_wastes')
                )
        )
        .addToNormalPresetList()
        .asDefaultPreset()
})

Chunk Generators

Chunk generators define the shape and biomes of a dimension. WorldJS adds builders for the vanilla types, but other addons may add their own types

minecraft:debug

Contains all possible blocks states laid out in a grid at y = 60

  • : The biome to place the states in
    • Must be set

minecraft:flat

A superflat world

  • : The structure sets to place in the world
    • Defaults to all structure sets
  • : Add a layer to the world
    • height: int: The thickness of the layer
      • Must be in the range [0, 4064]
    • block: Block: The block to place for the layer
  • : The biome of the world
    • Defaults to 'minecraft:plains'
  • : Allows lava lakes to generate
  • : Allows the placed features of the biome to generate

minecraft:noise

Uses noise to determine the shape and biomes of the world

  • : The noise settings of the world
    • Must be set
  • : Settings for the biome layout of the world
    • type: ResourceLocation: The id of a biome source builder type
    • biomeSourceBuilder: Consumer<BiomeSourceBuilder>: A callback to edit the properties of the biome source
      • The methods available will depend on the type
    • Must be set

Biome Sources

minecraft:checkerboard

Places biomes in a checkerboard pattern

  • : The size of the checkerboard grid
    • Must be in the range [0, 62]
    • Defaults to 2
  • : The biomes to place in the world
    • Must be set

minecraft:fixed

A single biome across the whole world

  • : The biome to use
    • Must be set

minecraft:multi_noise

Uses the world’s noise router to determine biome positions

One of the following must be set. If both are set, the preset will take precedence over the custom parameters

  • : The parameter preset to use
    • May be one of 'minecraft:overworld' or 'minecraft:nether'
  • : Build the climate parameters using a callback of the form
    • builder: ClimateParameterListBuilder: The builder, which has a single method available
      • .forBiome(biome: Holder$Reference<Biome>): ParameterEntry
        : Creates, adds, and returns a climate parameter entry for the referenced biome. Biomes may have multiple entries. Entries have the following methods, which all return the entry
        • .temperature(value: number): The temperature to place the biome at
          • Must be in the range [-2, 2]
          • Defaults to 0
        • .temperature(min: number, max: number): The temperature range to place the biome in
          • Must be in the range [-2, 2]
          • Defaults to 0
        • .humidity(value: number): The humidity to place the biome at
          • Must be in the range [-2, 2]
          • Defaults to 0
        • .humidity(min: number, max: number): The humidity range to place the biome in
          • Must be in the range [-2, 2]
          • Defaults to 0
        • .continentalness(value: number): The continentalness to place the biome at
          • Must be in the range [-2, 2]
          • Defaults to 0
        • .continentalness(min: number, max: number): The continentalness range to place the biome in
          • Must be in the range [-2, 2]
          • Defaults to 0
        • .erosion(value: number): The erosion to place the biome at
          • Must be in the range [-2, 2]
          • Defaults to 0
        • .erosion(min: number, max: number): The erosion range to place the biome in
          • Must be in the range [-2, 2]
          • Defaults to 0
        • .depth(value: number): The depth to place the biome at
          • Must be in the range [-2, 2]
          • Defaults to 0
        • .depth(min: number, max: number): The depth range to place the biome in
          • Must be in the range [-2, 2]
          • Defaults to 0
        • .weirdness(value: number): The weirdness to place the biome at
          • Must be in the range [-2, 2]
          • Defaults to 0
        • .weirdness(min: number, max: number): The weirdness range to place the biome in
          • Must be in the range [-2, 2]
          • Defaults to 0
        • .offset(offset: number): The suitability offset
          • Must be in the range [0, 1]
          • Defaults to 0

minecraft:the_end

The biome source used for the End

Has no methods available

Dimension Type

Dimension types define technical properties of a dimension like its building height limits and ambient light. WorldJS adds the ability to create dimension types through KubeJS’s ServerEvents.registry('dimension_type', event => {}) event vai the default (no type id) builder

  • : Fixes the dimension at the given day time, in ticks
    • Defaults to un-fixed time
  • : Marks the dimension as not having sky light
  • : Marks the dimension as having a logical ceiling
    • Note: This does not influence the actual generation of a ceiling in the dimension, that is controlled by the chunk generator
  • : Marks the dimension as being ultra warm. Enables water evaporation and faster lava spread, among other effects
  • : Marks the dimension as being unnatural, disabling compasses, beds, creaking spawns, and zombified piglins from spawn in nether portals
  • : Disallow sleeping in the dimension, causing them to explode on interact
  • : Disallow respawn anchors in the dimension, causing them to explode on interact
  • : The multiplier applied to coordinates when leaving the dimension
    • Must be in the range [1E-5, 3E7]
    • Defaults to 1
  • : The minimum height at which blocks can exist in the dimension
    • Must be in the range [-2032, 2031]
    • Must be a multiple of 16
    • Defaults to -64
  • : The total height in which blocks can exist in the dimension
    • Must be in the range [16, 4064]
    • Must be a multiple of 16
    • The maximum build height (minY + height - 1) cannot be greater than 2031
    • Defaults to 384
  • : The maximum height ‘natural’ teleporters (nether portals, chorus fruit) can bring players
    • Must be in the range [0, 4064]
    • Cannot be greater than height
    • Defaults to 384
  • : The blocks on which fires burn indefinitely on
    • Defaults to 'minecraft:infiniburn_overworld'
  • : The previously registered client-side effects of the dimension
    • Controls the cloud height, sky type, ambient light, and light map behaviors
    • Defaults to 'minecraft:overworld'
  • : How much ambient light the dimension has. 0 follows the light level and 1 has no ambient lighting
    • Defaults to 0
  • : The weather-affected maximum light allowed when a mob spawns
    • Must be in the range [0, 15]
    • Defaults to [0, 7]
  • : The maximum light allowed when a mob spawns
    • Must be in the range [0, 15]
    • Defaults to 7
  • : Disables piglins and hoglins transforming into their zombified variants when in the dimension
  • : Disables raids in the dimension

Example

ServerEvents.registry('dimension_type', event => {
    event.create('space')
        .withNoSkyLight()
        .coordinateScale(300)
        .minY(0)
        .height(64)
        .logicalHeight(64)
        .effects('minecraft:the_end')
        .noRaids()
})

Noise Generator Settings

Noise generator settings define the parameters used for the shape of terrain in noise-based chunk generators. WorldJS adds the ability to create noise generator settings through KubeJS’s ServerEvents.registry('worldgen/noise_settings', event => {}) event via the default (no type id) builder

  • : The world settings
    • minY: int: The minimum y coordinate where terrain will generate
      • Must be in the range [-2032, 2031]
      • Must be divisible by 16
      • Defaults to -64
    • height: int: The total height where terrain will generate
      • Must be in the range [0, 4064]
      • Must be divisible by 16
      • height plus minY may not exceed 2032
      • Defaults to 384
    • horizontalSize: int: The horizontal size of the noise
      • Must be in the range [1, 4]
      • Defaults to 1
    • verticalSize: int: The vertical size of the noise
      • Must be in the range [1, 4]
      • Defaults to 2
  • : The default block and fluid of the world
    • block: BlockState: The default block used for terrain
    • fluid: BlockState: The default block used for seas and lakes
    • Must be set
  • : The density functions used for generation parameters. Can be made as an object with the following params:
    • barrierNoise: DensityFunction: The DensityFunction for separation of aquifers and open areas in caves
      • Must be set
    • fluidLevelFloodednessNoise: DensityFunction: The DensityFunction for the probability of generating fluids in a cave for aquifers
      • Values will be clamped to [-1, 1]
      • Must be set
    • fluidLevelSpreadNoise: DensityFunction: The DensityFunction for the height of the liquid surface at a horizontal position
      • Must be set
    • lavaNoise: DensityFunction: The DensityFunction for if an aquifer should use lava instead
      • The threshold is 0.3
      • Must be set
    • temperature: DensityFunction: The DensityFunction for the temperature value used in biome placement
      • Must be set
    • vegetation: DensityFunction: The DensityFunction for the humidity value used in biome placement
      • Must be set
    • continents: DensityFunction: The DensityFunction for the continentalness value used in biome placement
      • Must be set
    • erosion: DensityFunction: The DensityFunction for the erosion values used in biome and aquifer placement
      • Must be set
    • depth: DensityFunction: The DensityFunction for the depth values used in biome and aquifer placement
      • Must be set
    • ridges: DensityFunction: The DensityFunction for the weirdness values in biome placement
      • Must be set
    • initialDensityWithoutJaggedness: DensityFunction: The DensityFunction for used for the initial terrain height for world generation
      • Must be set
    • finalDesnity: DensityFunction: The DensityFunction for determining if air or a default block is placed
      • If positive, a block that can be replaced by the surface rule. Otherwise, an air block where aquifers can generate
      • Must be set
    • veinToggle: DensityFunction: The DensityFunction for special, large ore veins
      • If greater than 0 the vein is copper
      • If less than or equal to 0 the vein is iron
      • Must be set
    • veinRidged: DensityFunction: The DensityFunction for which blocks are part of a vein
      • If greater than or equal to 0, the block is not part of a vein
      • If less than 0, the block is either the vein’s stone or ore block
      • Must be set
    • veinGap: DensityFunction: The DensityFunction for determining which blocks in a vein are ore blocks
      • Must be set
    • Must be set
  • : The surface rule source for the terrain’s blocks
    • Must be set
  • : Add a climate parameter point for where the player is allowed to spawn. The consumer has the methods available on ParameterEntrys of noise biome sources
  • : The (world generation) sea level
  • : Disables mob generation on chunk load
  • : Disables the generation of aquifers
  • : Disables the generation of special ore veins
  • : Use the pre-1.18 random number generator

Example

ServerEvents.registry('worldgen/noise_settings', event => {
    event.create('noisy')
        .defaults('minecraft:pink_glazed_terracotta', 'minecraft:lava')
        .noiseRouter({
            barrierNoise: {
                noise: {
                    noise: 'minecraft:aquifer_barrier',
                    xz_scale: 1,
                    y_scale: 1
                }
            },
            fluidLevelFloodednessNoise: {
                noise: {
                    noise: 'minecraft:aquifer_fluid_level_floodedness',
                    xz_scale: 1,
                    y_scale: 1
                }
            },
            fluidLevelSpreadNoise: {
                noise: {
                    noise: 'minecraft:aquifer_fluid_level_spread',
                    xz_scale: 1,
                    y_scale: 1
                }
            },
            lavaNoise: {
                noise: {
                    noise: 'minecraft:aquifer_lava',
                    xz_scale: 1,
                    y_scale: 1
                }
            },
            temperature: {
                cube: {
                    squeeze: {
                        mul: {
                            first: 0.1,
                            second: {
                                noise: {
                                    noise: 'minecraft:temperature',
                                    xz_scale: 0.13,
                                    y_scale: 1
                                }
                            }
                        }
                    }
                }
            },
            vegetation: 2,
            continents: {
                beardifier: {}
            },
            erosion: {
                end_islands: {}
            },
            depth: -2,
            ridges: {
                square: {
                    y_clamped_gradient: {
                        from_y: -64,
                        to_y: 320,
                        from_value: -3.68,
                        to_value: 1.49
                    }
                }
            },
            initialDensityWithoutJaggedness: 5,
            finalDensity: 5.1,
            veinToggle: 0,
            veinRidged: 0,
            veinGap: 0
        })
        .disableOreVeins()
        .seaLevel(92)
        .surfaceRule([
            {
                condition: {
                    if_true: {
                        noise_threshold: {
                            noise: 'minecraft:surface',
                            min_threshold: 0.2,
                            max_threshold: 0.8
                        }
                    },
                    then_run: 'badlands'
                }
            },
            {
                condition: {
                    if_true: {
                        y_above: {
                            anchor: 120,
                            surface_depth_multiplier: 1
                        }
                    },
                    then_run: 'minecraft:lime_stained_glass'
                }
            },
            'minecraft:pink_glazed_terracotta'
        ])
        .addSpawnTarget(builder =>
            builder.humidity(2)
                .temperature(-0.1, 0.1)
                .depth(-2)
        )
})

Biome

Biomes define the environment of a location in the world. WorldJS adds the ability to create new biomes through KubeJS’s ServerEvents.registry('worldgen/biome', event => {}) event via the default (no type id) builder

  • : Controls the grass/foliage color and height-adjusted temperature. Not related to the temperature of noise generators
    • Defaults to 0
  • : Controls the grass/foliage color
    • Defaults to 0
  • : The color used for fog
    • Defaults to 0
  • : The color used for water blocks and cauldrons
    • Defaults to 0
  • : The color used for water fog
    • Defaults to 0
  • : The color used for the sky
    • Defaults to 0
  • : The color used for leaves and vines
  • : The color used for grass blocks, short and tall grass, (tall) ferns, and sugarcane
  • : A modifier to apply to the grass color
    Reveal/hide valid grass color modifiers
    • none
    • dark_forest
    • swamp

    Mods may add additional values

    • Defaults to none
  • : The ambient particle of the biome
    • particleOptions: ParticleOptions: The particle to spawn
    • probability: number: How often the particle spawns
  • : The ambient sound
  • : The mood properties
    • sound: Holder$Reference<SoundEvent>: The mood sound
    • tickDelay: int: The minimum delay between two plays
    • blockSearchExtent: int: The range at which the mood algorithm can check
    • offset: number: How far the sound source should be from the player
  • : Settings for additions sound
    • sound: Holder$Reference<SoundEvent>: The sound to play
    • tickChance: number: The chance the sound will play each tick
  • : Specific music that should play in the biome
    • sound: Holder$Refence<SoundEvent>: The music sound
    • minDelay: int: The minimum delay between two music tracks
    • maxDelay: int: The maximum delay between two music tracks
    • replaceCurrentMusic: boolean: If currently playing music should be replaced
  • : Modifier for the temperature before calculating the height adjusted temperature
    Reveal/hide valid temperature modifiers
    • none
    • frozen
    • Defaults to none
  • : Disables precipitation in the biome
  • : The world carvers to use in the given carving step
    • carvingStep: GenerationStep$Carving: The carving step
      Reveal/hide valid carving steps
      • air
      • liquid
    • carver: HolderSet<ConfiguredWorldCarver<?>>: The carvers that will carve during the given carvingStep
  • : The placed features to place in the given decoration step
    • step: GenerationStep$Decoration: The decoration step to place feature in
      Reveal/hide valid decoration steps
      • raw_generation
      • lakes
      • local_modifications
      • underground_structures
      • surface_structures
      • strongholds
      • underground_ores
      • underground_decoration
      • fluid_springs
      • vegetal_decoration
      • top_layer_modification
    • feature: HolderSet<PlacedFeature>: The placed features that will be placed during the decoration step
  • : Add a mob spawn
    • category: MobCategory: The category of the spawn
      Reveal/hide valid mob categories
      • monster
      • creature
      • ambient
      • axolotls
      • underground_water_creature
      • water_creature
      • water_ambient
      • misc
    • type: EntityType<?>: The entity type to spawn
    • weight: int: How often the mob should spawn. Higher values means more spawns
    • minCount: int: The minimum number of the mob to spawn
    • maxCount: int: The maximum number of the mob to spawn
  • : Add a spawn cost for an entity
    • type: EntityType<?>: The entity type to add a spawn cost for
    • charge: number: The charge of the mob
    • energyBudget: number: The mob’s maximum potential
  • : The probability of creatures being spawned during world generation
    • Must be in the range [0, 0.9999999]
    • Defaults to 0.1

Example

ServerEvents.registry('worldgen/biome', event => {
    event.create('juice')
        .temperature(0.4)
        .downfall(2)
        .fogColor('#e83581')
        .waterColor('#e83581')
        .waterFogColor('#e83581')
        .skyColor('#e23aac')
        .foliageColor('#e9c034')
        .grassColor('#8662bb')
        .ambientSound('kubejs:juice/ambient')
        .moodSound('kubejs:juice/mood', 200, 4, 1.4)
        .additionsSound('kubejs:juice/additions', 0.2)
        .music('kubejs:juice/music', 200, 500, true)
        .carving('air', '#kubejs:silly_straws')
        .features('lakes', '#kubejs:juice_pools')
        .features('underground_ores', '#kubejs:gushers')
        .features('fluid_springs', '#kubejs:soda_machines')
        .features('underground_structures', ['kubejs:juice_dungeon'])
        .addSpawn('water_ambient', 'juice_mod:juice_fish', 100, 5, 17)
})