Configured & Placed Features

Configured features define what is placed in-world. WorldJS adds the ability to create all of vanilla’s configured feature types through KubeJS’s ServerEvents.registry('worldgen/configured_feature', event => {}) event

Placed features define the placement conditions of configured features. They can be made with KubeJS’s ServerEvents.registry('worldgen/placed_feature', event => {}) event, as described below

No Op

Type: no_op

Creates a minecraft:no_op configured feature

  • : Creates and modifies the placed feature which will place the configured feature
    • id?: ResourceLocation: The id of the placed feature
      • Defaults to the same id as the configured feature if not provided
      • Namespace defaults to kubejs if not specified
    • builder: Consumer<PlacedFeatureBuilder>: Set the placement of the feature

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('no_op', 'no_op')
        .withPlacement('kubejs:no_op', m => {})
})

Basalt Pillar

Type: basalt_pillar

Creates a minecraft:basalt_pillar configured feature

Inherits the methods of the no op builder

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('basalt_pillar', 'basalt_pillar')
        .withPlacement(p => p.modifiers(m => {
            m.minecraft.inSquare()
        }))
})

Blue Ice

Type: blue_ice

Creates a minecraft:blue_ice configured feature

Inherits the methods of the no op builder

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('blue_ice', 'blue_ice')
        .withPlacement(p => p.modifiers(m => {
            m.minecraft.count([2, 9])
        }))
})

Bonus Chest

Type: bonus_chest

Creates a minecraft:bonus_chest configured feature

Inherits the methods of the no op builder

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('bonus_chest', 'bonus_chest')
        .withPlacement(p => p.modifiers(m => {
            m.minecraft
                .fixed([[0, 0, 0], [0, 100, 0]])
                .horizontalRandomOffset([-8, 8])
        }))
})

Chorus Plant

Type: chorus_plant

Creates a minecraft:chorus_plant configured feature

Inherits the methods of the no op builder

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('chorus_plant', 'chorus_plant')
        .withPlacement(p => p.modifiers(m => {
            let { minecraft } = m
            minecraft
                .biome()
                .inSquare()
                .rarityFilter(17)
        }))
})

Coral Claw

Type: coral_claw

Creates a minecraft:coral_claw configured feature

Inherits the methods of the no op builder

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('coral_claw', 'coral_claw')
        .withPlacement(p => p.modifiers(m => {
            m.minecraft.surfaceWaterDepth(12)
        }))
})

Coral Mushroom

Type: coral_mushroom

Creates a minecraft:coral_mushroom configured feature

Inherits the methods of the no op builder

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('coral_mushroom', 'coral_mushroom')
        .withPlacement(p => p.modifiers(m => {
            m.minecraft.uniformHeightRange(
                { above_bottom: 15 },
                { below_top: 20 }
            )
        }))
})

Coral Tree

Type: coral_tree

Creates a minecraft:coral_tree configured feature

Inherits the methods of the no op builder

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('coral_tree', 'coral_tree')
        .withPlacement(p => p.modifiers(m => {
            m.minecraft.heightmap('ocean_floor_wg')
        }))
})

Desert Well

Type: desert_well

Creates a minecraft:desert_well configured feature

Inherits the methods of the no op builder

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('desert_well', 'desert_well')
        .withPlacement(p => p.jsonModifier({
            type: 'cheese_mod:extra_cheesy'
        }))
})

End Island

Type: end_island

Creates a minecraft:end_island configured feature

Inherits the methods of the no op builder

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('end_island', 'end_island')
        .withPlacement(p => p.modifiers(m => {
            m.minecraft.rarityFilter(60)
        }))
})

End Platform

Type: end_platform

Creates a minecraft:end_platform configured feature

Inherits the methods of the no op builder

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('end_platform', 'end_platform')
        .withPlacement(p => p.modifiers(m => {
            m.minecraft.inSquare()
        }))
})

Freeze Top Layer

Type: freeze_top_later

Creates a minecraft:freeze_top_later configured feature

Inherits the methods of the no op builder

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('freeze_top_later', 'freeze_top_later')
        .withPlacement(p => p.modifiers(m => {
            m.minecraft.biome()
        }))
})

Glowstone Blob

Type: glowstone_blob

Creates a minecraft:glowstone_blob configured feature

Inherits the methods of the no op builder

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('glowstone_blob', 'glowstone_blob')
        .withPlacement(p => p.modifiers(m => {
            m.minecraft.inSquare()
        }))
})

Ice Spike

Type: ice_spike

Creates a minecraft:ice_spike configured feature

Inherits the methods of the no op builder

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('ice_spike', 'ice_spike')
        .withPlacement(p => p.modifiers(m => {
            m.minecraft.heightmap('world_surface_wg')
        }))
})

Kelp

Type: kelp

Creates a minecraft:kelp configured feature

Inherits the methods of the no op builder

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('kelp', 'kelp')
        .withPlacement(p => p.modifiers(m => {
            m.minecraft.surfaceWaterDepth(5)
        }))
})

Monster Room

Type: monster_room

Creates a minecraft:monster_room configured feature

Inherits the methods of the no op builder

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('monster_room', 'monster_room')
        .withPlacement(p => p.modifiers(m => {
            m.minecraft.surfaceRelativeThreshold(
                'ocean_floor_wg',
                -12,
                -61
            )
        }))
})

Vines

Type: vines

Creates a minecraft:vines configured feature

Inherits the methods of the no op builder

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('vines', 'vines')
        .withPlacement(p => p.modifiers(m => {
            m.minecraft.carvingMask('air')
        }))
})

Void Start Platform

Type: void_start_platform

Creates a minecraft:void_start_platform configured feature

Inherits the methods of the no op builder

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('void_start_platform', 'void_start_platform')
        .withPlacement(p => p.modifiers(m => {
            m.minecraft.biome()
        }))
})

Weeping Vines

Type: weeping_vines

Creates a minecraft:weeping_vines configured feature

Inherits the methods of the no op builder

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('weeping_vines', 'weeping_vines')
        .withPlacement(p => p.modifiers(m => {
            m.minecraft.inSquare()
        }))
})

Bamboo

Type: bamboo

Creates a minecraft:bamboo configured feature

Inherits the methods of the no op builder

  • : The chance a podzol disk spawns under the bamboo stalk
    • Must be in the range [0, 1]
    • Defaults to 1

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('bamboo', 'bamboo')
        // TODO
})

Basalt Columns

Type: basalt_columns

Creates a minecraft:basalt_columns configured feature

Inherits the methods of the no op builder

  • : The max radius of the column
    • Must be in the range [0, 3]
    • Must be set
  • : The maximum height of the column
    • Must be in the range [1, 10]
    • Must be set

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('basalt_columns', 'basalt_columns')
        // TODO
})

Block Column

Type: block_column

Creates a minecraft:block_column configured feature

Inherits the methods of the no op builder

  • : Adds a column layer
    • height: IntProvider: The IntProvider describing the height of the layer
      • Must be non-negative
    • state: BlockstateProvider: The BlockStateProvider to place for the layer
  • : The direction the column places in
    Reveal/hide list of directions
    • up
    • down
    • east
    • west
    • north
    • south
    • Defaults to up
  • : The BlockPredicate check for each layer of the column
  • : Makes the column remove layers from the start of the column when space is restricted

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('block_column', 'block_column')
        // TODO
})

Block Pile

Type: block_pile

Creates a minecraft:block_pile configured feature

Inherits the methods of the no op builder

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('block_pile', 'block_pile')
        // TODO
})

Delta Feature

Type: delta_feature

Creates a minecraft:delta_feature configured feature

Inherits the methods of the no op builder

  • : The block to place as the interior of the delta
    • Defaults to minecraft:air
  • : The block to place as the rim of the delta
    • Defaults to minecraft:air
  • : The size of the delta interior
    • Must be in the range [0, 16]
    • Must be set
  • : The size of the rim
    • Must be in the range [0, 16]
    • Must be set

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('delta_feature', 'delta_feature')
        .size([11, 15])
        .rimSize([ 1, 3])
        .rim('minecraft:calcite')
        .contents('minecraft:lava')
        .withPlacement('minecraft:delta', p => {
            p.modifiers(modifiers => {
                let { minecraft } = modifiers
                minecraft
                    .countOnEveryLayer(40)
                    .biome()
            })
        })
})

Disk

Type: disk

Creates a minecraft:disk configured feature

Inherits the methods of the no op builder

  • : The block(s) to place
    • fallback: BlockStateProvider: The fallback BlockStateProvider to place if no rules pass
    • rules: List<RuleProvider>: A list of RuleProviders, which can be made as an object with the following fields
    • Must be set
  • : The BlockPredicate for checking if the feature may place
    • Must be set
  • : The radius of the disk, as an IntProvider
    • Must be in the range [0, 8]
    • Must be set
  • : Half the height of the disk
    • Must be in the range [0, 4]
    • Defaults to 0

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('disk', 'disk')
        // TODO
})

Dripstone Cluster

Type: dripstone_cluster

Creates a minecraft:dripstone_cluster configured feature

Inherits the methods of the no op builder

  • : How many blocks the feature searches for the floor or ceiling
    • Must be in the range [1, 512]
    • Defaults to 1
  • : The height of the cluster as an IntProvider
    • Must be in the range [1, 128]
    • Must be set
  • : The radius of the cluster as an IntProvider
    • Must be in the range [1, 128]
    • Must be set
  • : The maximum difference between the height of stalagmites and stalactites
    • Must be in the range [0, 64]
    • Defaults to 1
  • : The maximum difference from the height of a dripstone
    • Must be in the range [1, 64]
    • Defaults to 1
  • : The dripstone block layer’s thickness as an IntProvider
    • Must be in the range [0, 128]
    • Must be set
  • : The density of the columns as a FloatProvider
    • Must be in the range [0, 2]
    • Must be set
  • : The chance of also placing a pool as a FloatProvider
    • Must be in the range [0, 2]
    • Must be set
  • : The chance there is a column at the maximum distance from the center
    • Must be in the range [0, 1]
    • Defaults to 0
  • : The maximum distance form the center that can influence the chance of the column placing
    • Must be in the range [1, 64]
    • Defaults to 1
  • : The maximum distance from the center that can influence the height bias
    • Must be in the range [1, 64]
    • Defaults to 1

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('dripstone_cluster', 'dripstone_cluster')
        // TODO
})

Large Dripstone

Type: large_dripstone

Creates a minecraft:large_dripstone configured feature

Inherits the methods of the no op builder

  • : The search range from start point to cave floor or ceiling
    • Must be in the range [1, 512]
    • Defaults to 30
  • : The minimum and maximum radius of the column as an IntProvider
    • Must be in the range [1, 60]
    • Must be set
  • : The height scale as a FloatProvider
    • A higher scale means a higher height
    • Must be in the range [0, 20]
    • Must be set
  • : The maximum radius between the column radius and the cave height
    • Must be in the range [0.1, 1]
    • Defaults to 0.1
  • : The bluntness/truncation of stalactites as a FloatProvider
    • Higher values lead to shorter height
    • Must be in the range [0.1, 10]
    • Must be set
  • : The bluntness/truncation of stalagmites as a FloatProvider
    • Higher values lead to shorter height
    • Must be in the range [0.1, 10]
    • Must be set
  • : The inclination of the feature as a FloatProvider
    • Must be in the range [0, 2]
    • Must be set
  • : The minimum column radius for wind to cause an inclination
    • Must be in the range [0, 100]
    • Must be set
  • : The minimum bluntness value wind to cause an inclination
    • Must be in the range [0, 5]
    • Defaults to 0

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('large_dripstone', 'large_dripstone')
        // TODO
})

Pointed Dripstone

Type: pointed_dripstone

Creates a minecraft:pointed_dripstone configured feature

Inherits the methods of the no op builder

  • : The probability of a two tall dripstone generating
    • Must be in the range [0, 1]
    • Defaults to 0.2
  • : The probability a dripstone spreads in a horizontal direction
    • Must be in the range [0, 1]
    • Defaults to 0.7
  • : The probability dripstone spreads horizontally two blocks
    • Must be in the range [0, 1]
    • Defaults to 0.5
  • : The probability dripstone spreads horizontally a third block after the second block spread
    • Must be in the range [0, 1]
    • Defaults to 0.5

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('pointed_dripstone', 'pointed_dripstone')
        // TODO
})

End Gateway

Type: end_gateway

Creates a minecraft:end_gateway configured feature

Inherits the methods of the no op builder

  • : If entities should teleport to the exact exit position
    • Ignored if the exit is not defined
    • Defaults to false
  • : Set the exit position of the gateway

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('end_gateway', 'end_gateway')
        // TODO
})

End Spike

Type: end_spike

Creates a minecraft:end_spike configured feature

Inherits the methods of the no op builder

  • : Makes the placed crystals invulnerable
  • : The position the crystal beams target
  • : Add a spike to the list of generated spikes
    • centerX: int: The x coordinate of the spike
    • centerZ: int: The z coordinate of the spike
    • radius: int: The radius of the spike
    • height: int: The height of the spike
    • guarded: boolean: If the crystal should be surrounded by an iron bar cage

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('end_spike', 'end_spike')
        // TODO
})

Fill Layer

Type: fill_layer

Creates a minecraft:fill_layer configured feature

Inherits the methods of the no op builder

  • : The IntProvider height of the layer
    • Must be in the range [0, 4064]
    • Must be set
  • : The block to fill the layer with
    • Defaults to minecraft:air

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('fill_layer', 'fill_layer')
        // TODO
})

Flower

Type: flower

Creates a minecraft:flower configured feature

Inherits the methods of the random patch builder

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('flower', 'flower')
        // TODO
})

Forest Rock

Type: forest_rock

Creates a minecraft:forest_rock configured feature

Inherits the methods of the no op builder

  • : The state to place
    • Defaults to air

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('forest_rock', 'forest_rock')
        // TODO
})

Fossil

Type: fossil

Creates a minecraft:fossil configured feature

Inherits the methods of the no op builder

  • : The ids of fossil structure templates to choose from
  • : The ids of overlay structure templates to choose from
  • : The fossil StructureProcessorList to use
    • Must be set
  • : The overlay StructureProcessorList to use
    • Must be set
  • : How many corners may be empty while still allowing the structure to generate
    • Must be in the range [0, 7]
    • Defaults to 0

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('fossil', 'fossil')
        // TODO
})

Geode

Type: geode

Creates a minecraft:geode configured feature

Inherits the methods of the no op builder

  • : The GeodeBlocks which define the blocks the geode will place. GeodeBlocks can be made as an object with the fields
    • filling?: BlockStateProvider: The BlockStateProvider of the filling layer
      • Defaults to minecraft:air
    • innerLayer?: BlockStateProvider: The BlockStateProvider of the inner layer
      • Defaults to minecraft:amethyst_block
    • alternativeInnerLayer?: BlockStateProvider: The alternative BlockStateProvider of the inner layer
      • Defaults to minecraft:budding_amethyst
    • middleLayer?: BlockStateProvider: The BlockStateProvider of the middle layer
      • Defaults to minecraft:calcite
    • outerLayer?: BlockStateProvider: The BlockStateProvider of the outer layer
      • Defaults to minecraft:smooth_basalt
    • innerPlacements?: List<BlockState>: The blocks to place adjacent to the alternative inner layer blocks
      • Defaults to ['minecraft:small_amethyst_bud', 'minecraft:medium_amethyst_bud', 'minecraft:large_amethyst_bud', 'minecraft:amethyst_cluster']
      • Must not be empty
    • cannotReplace?: TagKey<Block>: The tag id of blocks which the geode cannot replace
      • Defaults to minecraft:feature_cannot_replace
    • invalidBlocks?: TagKey<Block>: The tag id of blocks which the geode considers invalid for spawning
      • Defaults to minecraft:geode_invalid_blocks
    • Defaults to all of the above defaults
  • : The GeodeLayers which defines the thickness of the geode’s layers. GeodeLayers can be made as an object with the fields
    • filling?: float: The width of the filling layer
      • Defaults to 1.7
    • innerLayer?: float: The width of the inner layer
      • Defaults to 2.2
    • middleLayer?: float: The width of the middle layer
      • Defaults to 3.2
    • outerLayer?: float: the width of the outer layer
      • Defaults to 4.2
    • Defaults to all of the above defaults
  • : The GeodeCrack which defines the geode’s crack. A GeodeCrack can be made as an object with the fields
    • generateChance?: float: The probability the geode generates with a crack
      • Must be in the range [0, 1]
      • Defaults to 1
    • baseSize?: float: The base size of the crack
      • Must be in the range [0, 5]
      • Defaults to 2
    • pointOffset?: int: The offset applied to the crack
      • Must be in the range [0, 10]
      • Defaults to 2
    • Defaults to all of the above defaults
  • : The probability of placing an inner placement block next to an inner layer block
    • Must be in the range [0, 1]
    • Defaults to 0.35
  • : The chance to place an alternative inner place block instead of a regular inner layer block
    • Must be in the range [0, 1]
    • Defaults to 0
  • : The IntProvider offset on each coordinate of the center from the feature start
    • Must be in the range [1, 20]
    • Defaults to [4, 5]
  • : The number of distribution points as an IntProvider
    • Must be in the range [1, 20]
    • Defaults to [3, 4]
  • : The point offset as an IntProvider
    • Must be in the range [0, 10]
    • Defaults to [1, 2]
  • : The minimum Chebyshev distance between a geode block and the center
    • Defaults to -16
  • : The maximum Chebyshev distance between a geode block and the center
    • Defaults to 16
  • : The noise multiplier
    • Must be in the range [0, 1]
    • Defaults to 0.05
  • : The threshold for invalid blocks
    • Found by checking distribution points amount of times near the center of the geode
      • Will not generate if the found count is greater than the given value
    • defaults to 0

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('geode', 'geode')
        // TODO
})

Huge Fungus

Type: huge_fungus

Creates a minecraft:huge_fungus configured feature

Inherits the methods of the no op builder

  • : The block to place the feature on
    • Must be set
  • : The stem block to place
    • Must be set
  • : The hat block to place
    • Must be set
  • : The block to place for decoration
    • Must be set
  • : The BlockPredicate that determines which blocks can be replaced by the feature
    • Defaults to true
  • : Allows the feature to exceed the world ceiling and makes blocks replaced by the feature drop their items

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('huge_fungus', 'huge_fungus')
        // TODO
})

Huge Brown Mushroom

Type: huge_brown_mushroom

Creates a minecraft:huge_brown_mushroom configured feature

Inherits the methods of the no op builder

  • : The BlockStateProvider to use for the cap
    • Must be set
  • : The BlockStateProvider to use for the stem
    • Must be set
  • : The size of the cap
    • Defaults to 2

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('huge_brown_mushroom', 'huge_brown_mushroom')
        // TODO
})

Huge Red Mushroom

Type: huge_red_mushroom

Creates a minecraft:huge_red_mushroom configured feature

Inherits the methods of the huge brown mushroom builder

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('huge_red_mushroom', 'huge_red_mushroom')
        // TODO
})

Iceberg

Type: iceberg

Creates a minecraft:iceberg configured feature

Inherits the methods of the forest rock builder

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('iceberg', 'iceberg')
        // TODO
})

Lake

Type: lake

Creates a minecraft:lake configured feature

Inherits the methods of the no op builder

  • : The BlockStateProvider to place as the lake’s fluid
    • Must be set
  • : The BlockStateProvider to place as the lake’s barrier
    • Defaults to minecraft:air, which does not replace blocks

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('lake', 'lake')
        // TODO
})

Multiface Growth

Type: multiface_growth

Creates a minecraft:multiface_growth configured feature

Inherits the methods of the no op builder

  • : The block to place
    • Must be an instance of MultifaceBlock
    • Must be set
  • : The range to search for a placement position
    • Must be in the range [1, 64]
    • Defaults to 1
  • : Allow the feature to place on floors
  • : Allow the feature to place on ceilings
  • : Allow the feature to place on walls
  • : The chance the feature can spread
    • Must be in the range [0, 1]
    • Defaults to 0
  • : The block(s) the placed block can be placed on
    • Defaults to []

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('multiface_growth', 'multiface_growth')
        // TODO
})

Nether Forest Vegetation

Type: nether_forest_vegetation

Creates a minecraft:nether_forest_vegetation configured feature

Inherits the methods of the no op builder

  • : The BlockStateProvider to place
  • : The horizontal distance to spread over
    • Must be in the range [1, )
    • Defaults to 1
  • : The vertical distance to spread over
    • Must be in the range [1, )
    • Defaults to 1

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('nether_forest_vegetation', 'nether_forest_vegetation')
        // TODO
})

No Bonemeal Flower

Type: no_bonemeal_flower

Creates a minecraft:no_bonemeal_flower configured feature

Inherits the methods of the random patch builder

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('no_bonemeal_flower', 'no_bonemeal_flower')
        // TODO
})

Ore

Type: ore

Creates a minecraft:ore configured feature

Inherits the methods of the no op builder

  • : Adds an OreTarget to the feature’s list of targets. OreTargets can be made as an object with the fields
    • target: RuleTest: The RuleTest that checks the block to replace
    • state: BlockState: the state to place if target passes
  • : The size of the ore vein
    • Must be in the range [0, 64]
    • Defaults to 0
  • : The chance the whole ore blob is discarded if any of its blocks neighbor air
    • Must be in the range [0, 1]
    • Defaults to 0

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('ore', 'ore')
        // TODO
})

Scattered Ore

Type: scattered_ore

Creates a minecraft:scattered_ore configured feature

Inherits the methods of the ore builder

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('scattered_ore', 'scattered_ore')
        // TODO
})

Random Patch

Type: random_patch

Creates a minecraft:random_patch configured feature

Inherits the methods of the no op builder

  • : The number of attempts to generate
    • Defaults to 128
  • : The horizontal spread range
    • Must be non-negative
    • Defaults to 7
  • : The vertical spread range
    • Must be non-negative
    • Defaults to 3
  • : The placed feature to generate multiple of
    • Must be set

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('random_patch', 'random_patch')
        // TODO
})

Replace Blobs

Type: replace_blobs

Creates a minecraft:replace_blobs configured feature

Inherits the methods of the no op builder

  • : The block to replace
    • Defaults to minecraft:air
  • : The state to place
    • Defaults to minecraft:air
  • : The blob radius
    • Must be in the range [0, 12]
    • Must be set

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('replace_blobs', 'replace_blobs')
        // TODO
})

Replace Single Block

Type: replace_single_block

Creates a minecraft:replace_single_block configured feature

Inherits the methods of the no op builder

  • : The replacement targets
    • OreTargetStates can be made as an object with following fields
      • target: RuleTest: A RuleTest, the validation for if state can place
      • state: BlockState: The block state to place if target matches

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('replace_single_block', 'replace_single_block')
        // TODO
})

Root System

Type: root_system

Creates a minecraft:root_system configured feature

Inherits the methods of the no op builder

  • : The feature to place on top of the root system
    • Must be set
  • : The required vertical space for the tree feature to generate
    • Must be in the range [1, 64]
    • Defaults to 1
  • : The radius to place roots in
    • Must be in the range [1, 64]
    • Defaults to 1
  • : The blocks that cane be replaced by roots
    • Must be set
  • : The BlockStateProvider to use for the root blob
    • Must be set
  • : The number times to attempt to place root blocks
    • Must be in the range [1, 256]
    • Defaults to 1
  • : The maximum height of the root column/blob
    • Must be in the range [1, 4096]
    • Defaults to 1
  • : The radius at which to place hanging roots
    • Must be in the range [1, 64]
    • Defaults to 1
  • : The vertical range over which to place hanging roots
    • Must be in the range [0, 16]
    • Defaults to 1
  • : The BlockStateProvider to use for blocks which hang below the main root blob
    • Must be set
  • : The number of times to try to place hanging root blocks
    • Must be in the range [1, 256]
    • Defaults to 1
  • : The maximum allowable submerged height the tree may be in
    • Must be in the range [1, 64]
    • Defaults to 1
  • : The BlockPredicate check for the tree’s position
    • Defaults to true

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('root_system', 'root_system')
        // TODO
})

Sculk Patch

Type: sculk_patch

Creates a minecraft:sculk_patch configured feature

Inherits the methods of the no op builder

  • : The number of charges
    • Must be in the range [1, 32]
    • Defaults to 1
  • : The initial value of each charge
    • Must be in the range [1, 500]
    • Defaults to 1
  • : The number of attempts to spread
    • Must be in the range [0, 64]
    • Defaults to 1
  • : The number of times to generate
    • Must be in the range [0, 8]
    • Defaults to 1
  • : The number of times to spread
    • Must be in the range [0, 8]
    • Defaults to 0
  • : The number of extra shriekers to generate as an IntProvider
    • Must be set
  • : The chance of generating a catalyst
    • Must be in the range [0, 1]
    • Defaults to 0

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('sculk_patch', 'sculk_patch')
        // TODO
})

Sea Pickle

Type: sea_pickle

Creates a minecraft:sea_pickle configured feature

Inherits the methods of the no op builder

  • : The number of times to place as a IntProvider
    • Must be in the range [0, 256]
    • Must be set

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('sea_pickle', 'sea_pickle')
        // TODO
})

Seagrass

Type: seagrass

Creates a minecraft:seagrass configured feature

Inherits the methods of the no op builder

  • : Probability of using tall seagrass instead of regular seagrass
    • Must be in the range [0, 1]
    • Defaults to 1

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('seagrass', 'seagrass')
        // TODO
})

Simple Block

Type: simple_block

Creates a minecraft:simple_block configured feature

Inherits the methods of the no op builder

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('simple_block', 'simple_block')
        // TODO
})

Spring

Type: spring

Creates a minecraft:spring configured feature

Inherits the methods of the no op builder

  • : The fluid to place, as derived from the block
  • : The fluid to place. Note: there is not a FluidState wrapper, so an actual FluidState object is required
  • : If the spring requires a block matching the spring’s valid blocks below to generate
  • : The number of neighboring blocks that must match the valid blocks of the spring
    • Defaults to 4
  • : The required number of air blocks adjacent to the spring
    • The above block is not counted
    • Defaults to 1
  • : The blocks the spring requires to generate
    • Defaults to []

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('spring', 'spring')
        // TODO
})

Random Boolean Selector

Type: random_boolean_selector

Creates a minecraft:random_boolean_selector configured feature

Inherits the methods of the no op builder

  • : The id of a feature to place on a random true result
    • Must be set
  • : The if of the feature to place on a random false result
    • Must be set

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('random_boolean_selector', 'random_boolean_selector')
        // TODO
})

Random Selector

Type: random_selector

Creates a minecraft:random_selector configured feature

Inherits the methods of the no op builder

  • : Adds the weighted feature to the list of possible features
    • feature: Holder$Reference<PlacedFeature>: the id of the feature to place
    • chance: float: The chance, in the range [0, 1], the feature is placed
    • Note: Feature chances are evaluated sequentially and the first to place will be the only feature to place
  • : The feature to place if all chanced features fail to place
    • Must be set

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('random_selector', 'random_selector')
        // TODO
})

Simple Random Selector

Type: simple_random_selector

Inherits the methods of the no op builder

  • : The features to randomly choose from to place
    • Must be set

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('simple_random_selector', 'simple_random_selector')
        // TODO
})

Weighted Random Selector

Type: worldjs:weighted_random_selector

Creates a worldjs:weighted_random_selector configured feature

This works similarly to the simple random selector feature type, but only accepts a list of features which can be individually weighted

Inherits the methods of the no op builder

  • : The features to place as WeightedValues
    • The list must not be empty
    • Must be set

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('random_select', 'worldjs:weighted_random_selector')
        // TODO
})

Tree

Type: tree

Creates a minecraft:tree configured feature

Inherits the methods of the no op builder

  • : The BlockStateProvider to use for the trunk of the tree
    • Must be set
  • : The trunk placer which defines how the trunk is placed
    • Must be set
  • : The BlockStateProvider to use for the foliage of the tree
    • Must be set
  • : The foliage placer which defines how the foliage is placed
    • Must be set
  • : The root placer of the tree
  • : The BlockStateProvider to place around the tree
  • : The minimum size required for the tree to place
    • Must be set
  • : The tree decorators, additional blocks to place on and around the tree
  • : Allow the tree to ignore vines blocking its spawn position
  • : Force the dirt to be placed, even if the ground was already dirt-like

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('tree', 'tree')
        // TODO
})

Underwater Magma

Type: underwater_magma

Creates a minecraft:underwater_magma configured feature

Inherits the methods of the no op builder

  • : The maximum distance to search for a placement position
    • Must be in the range [0, 512]
    • Defaults to 0
  • : The radius around the selected position to potentially place magma
    • Must be in the range [0, 64]
    • Defaults to 0
  • .placementProbabilityPerValidPosition(probability: float){: .language-kube-21 #underwater-magma-The probability of a magma block being placed at any given selected position
    • Must be in the range [0, 1]
    • Defaults to 0

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('underwater_magma', 'underwater_magma')
        // TODO
})

Twisting Vines

Type: twisting_vines

Creates a minecraft:twisting_vines configured feature

Inherits the methods of the no op builder

  • : The max spread width
    • Must be in the range [1, )
    • Defaults to 1
  • : The max spread height
    • Must be in the range [1, )
    • Defaults to 1
  • : The maximum height
    • Must be in the range [1, )
    • Defaults to 1

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('twisting_vines', 'twisting_vines')
        // TODO
})

Vegetation Patch

Type: vegetation_patch

Creates a minecraft:vegetation_patch configured feature

Inherits the methods of the no op builder

  • : The blocks that can be replaced with vegetation
    • Must be set
  • : the BlockStateProvider use to generate the column
    • Must be set
  • : The feature to place on finding a valid position
    • Must be set
  • : The CaveSurface to place on
    Reveal/hide list of valid cave surfaces
    • ceiling
    • floor
    • Defaults to floor
  • : An IntProvider describing the amount of blocks that should be replaced
    • Must be in the range [1, 128]
    • Must be set
  • : The chance to add an extra block to the height
    • Must be in the range [0, 1]
    • Defaults to 0
  • : The y radius in which the column should search for available placement
    • Must be in the range [1, 256]
    • Defaults to 1
  • : The chance of placing the vegetation feature on finding a valid position
    • Must be in the range [0, 1]
    • Defaults to 0
  • : The horizontal radius to search for valid positions
    • Must be set
  • : The chance to add an extra search position next to the initial rectangle
    • Must be in the range [0, 1]
    • Defaults to 0

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('vegetation_patch', 'vegetation_patch')
        // TODO
})

Waterlogged Vegetation Patch

Type: waterlogged_vegetation_patch

Creates a minecraft:waterlogged_vegetation_patch configured feature

Inherits the methods of the vegetation patch builder

Example

ServerEvents.registry('worldgen/configured-feature', event => {
    event.create('waterlogged_vegetation_patch', 'waterlogged_vegetation_patch')
        // TODO
})

Placed Features

Placed features can be created using the JS event or via the .withPlacement(...) method of a configured feature builder

  • : Sets the configured feature the placed feature will place
    • Note: Will be ignored if the placed feature is derived from a configured feature builder
  • : Add the provided placement modifier
  • : Add the provided json-defined placement modifier
  • : Add pre-defined placement modifiers via namespaced methods
  • .tag(tag...: ResourceLocation[]): Adds the tag(s) to the placed feature

Example

ServerEvents.registry('worldgen/placed_feature', event => {
    event.create('sugar_cane_everywhere')
        .configuredFeature('minecraft:patch_sugar_cane')
        .modifiers(modifiers => {
            let { minecraft } = modifiers
            minecraft.biome()
                .inSquare()
                .heightmap('world_surface_wg')
        })
})

Placed Feature Modifiers

Placement modifiers are created and added to placed features through a namespaced system of methods. The namespaces can be retrieved from the PlacedFeatureBuilder$Modifiers provided in the callback of .modifiers(...). All methods available from a namespace return the namespace, allowing for multiple modifiers from the same namespace to be added with minimal friction

By default WorldJS adds the following vanilla placement modifiers under the minecraft namespace, but other mods can add namespaces and methods of their own

  • : Add a minecraft:biome modifier. Restricts the feature to only place in biomes that include this feature
  • : Add a minecraft:in_square modifier. Adds a random x and z offset to the placement position between 0 and 15
  • : Add a minecraft:count modifier
    • count: IntProvider: The number of times to place at the position, in the range [0, 256]
  • : Add a minecraft:fixed_placement modifier
    • positions: BlockPos[]: The positions to place at, if in the same chunk as the placement is occurring in
  • : Add a minecraft:rarity_filter modifier
    • chance: int: The chance the feature will successfully place at a position as 1 / chance
  • : Add a minecraft:carving_mask modifier
    • carvingStep: GenerationStep$Carving: The carving step volume for which the feature will try to place in. Does not include blocks ‘carved’ out by noise caves
      Reveal/hide list of carving steps
      • air
      • liquid
  • : Add a minecraft:heightmap modifier
    • heightmap: Heightmap$Types: The heightmap to place on
      Reveal/hide list of heightmap types
      • motion_blocking
      • motion_blocking_no_leaves
      • ocean_floor
      • ocean_floor_wg
      • world_surface
      • world_surface_wg
  • : Add a minecraft:noise_based_count modifier
    • noiseToCountRatio: int: The ratio of noise value to count
    • noiseFactor: float: The horizontal scale factor of the noise. Higher values make wider, more spaced out peaks
    • noiseOffset?: float: The vertical offset of the noise. Optional, defaults to 0
  • : Add a minecraft:noise_threshold_count modifier
    • noiseLevel: float: The threshold for determining if aboveNoise or belowNoise should be used
    • belowNoise: int: The count to use when below the threshold
    • aboveNoise: int: The count to use when above the threshold
  • : Add a minecraft:random_offset modifier
    • xzSpread: IntProvider: The horizontal spread, in the range [-16, 16]
    • ySpread: IntProvider: The vertical spread, in the range [-16, 16]
  • : Add a purely vertical minecraft:random_offset modifier
    • ySpread: IntProvider: The vertical spread, in the range [-16, 16]
  • : Add a purely horizontal minecraft:random_offset modifier
    • xzSpread: IntProvider: The horizontal spread, in the range [-16, 16]
  • : Add a minecraft:count_on_every_layer modifier
    • count: IntProvider: The count on each layer, in the range [0, 256]
  • : Add a minecraft:environment_scan modifier
    • directionOfSearch: Direction: The direction to search in
      Reveal/hide list of directions
      • up
      • down
      • east
      • west
      • north
      • south
    • targetCondition: BlockPredicate: The block predicate to search for
    • allowedSearchCondition?: BlockPredicate: The block predicate to validate each step to the targetCondition. Optional, approves everything if not specified
    • maxSteps: int: the maximum number of blocks, in the range [1, 32], out from the original position to search for
  • : Add a minecraft:surface_relative_threshold_filter modifier
    • heightmap: Heightmap$Types: The heightmap to be within range of
      Reveal/hide list of heightmap types
      • motion_blocking
      • motion_blocking_no_leaves
      • ocean_floor
      • ocean_floor_wg
      • world_surface
      • world_surface_wg
    • minInclusive: int: The minimum elevation difference from the heightmap
    • maxInclusive: int: The maximum elevation difference from the heightmap
  • : Add a minecraft:surface_relative_threshold_filter modifier with no minimum bound
    • heightmap: Heightmap$Types: The heightmap to be within range of
      Reveal/hide list of heightmap types
      • motion_blocking
      • motion_blocking_no_leaves
      • ocean_floor
      • ocean_floor_wg
      • world_surface
      • world_surface_wg
    • maxInclusive: int: The maximum elevation difference from the heightmap
  • : Add a minecraft:surface_relative_threshold_filter modifier with no maximum bound
    • heightmap: Heightmap$Types: The heightmap to be within range of
      Reveal/hide list of heightmap types
      • motion_blocking
      • motion_blocking_no_leaves
      • ocean_floor
      • ocean_floor_wg
      • world_surface
      • world_surface_wg
    • minInclusive: int: The minimum elevation difference from the heightmap
  • : Add a minecraft:surface_water_depth_filter modifier
    • maxWaterDepth: int: The maximum depth of water under which the feature can be placed
  • : Add a minecraft:block_predicate_filter modifier
    • predicate: BlockPredicate: The validator for a placing at a position
  • : Add a minecraft:height_range modifier
    • height: HeightProvider: The height range over which the feature can place
  • : Add a minecraft:height_range modifier that has a uniform chance of placing anywhere in the bounds
    • minInclusive: VerticalAnchor: A vertical anchor, the lower placement bound
    • maxInclusive: VerticalAnchor: A vertical anchor, the upper placement bound
  • : Add a minecraft:height_range modifier that has the highest chance of placing the feature in the center of the bounds
    • minInclusive: VerticalAnchor: A vertical anchor, the lower placement bound
    • maxInclusive: VerticalAnchor: A vertical anchor, the upper placement bound
  • : Add a minecraft:height_range modifier that places the feature at the exact height given