PlacedFeatureBuilder

class PlacedFeatureBuilder(id: ResourceLocation) : RegistryElementBuilder<PlacedFeature>

Builder for PlacedFeatures. Use build to get the PlacedFeature instance or register to register it. Check out the docs page on PlacedFeatures for more information.

See also

PlacedFeature
ConfiguredFeature

Constructors

Link copied to clipboard
constructor(id: ResourceLocation)

Properties

Link copied to clipboard
val id: ResourceLocation

Functions

Link copied to clipboard

Adds a BiomeFilter to this PlacedFeature, which returns the position if the configured feature is registered in the biome's feature list at the given position. Empty otherwise.

Link copied to clipboard
fun blockPredicateFilter(predicate: BlockPredicate)

Adds a BlockPredicateFilter with the given BlockPredicate to this PlacedFeature, which returns the position if the BlockPredicate matches the block at the given position. Empty otherwise.

Link copied to clipboard
fun carvingMaskBlocks(step: GenerationStep.Carving)

Adds a CarvingMaskPlacement to this PlacedFeature, which returns all positions in the given position's chunk that were carved out by a WorldCarver in the specified GenerationStep.Carving.

Link copied to clipboard
fun configuredFeature(configuredFeature: Holder<ConfiguredFeature<*, *>>)

Sets the ConfiguredFeature that should be placed by this PlacedFeature via a Holder that either already contains the ConfiguredFeature, or is set later by the ConfiguredFeature Registry.

fun configuredFeature(configuredFeatureKey: ResourceKey<ConfiguredFeature<*, *>>)

Sets the ConfiguredFeature that should be placed by this PlacedFeature via its ResourceKey. If the ConfiguredFeature is not yet registered, an empty Holder will be created and the ConfiguredFeature will be set later by the ConfiguredFeature Registry.

fun configuredFeature(configuredFeatureId: ResourceLocation)

Sets the ConfiguredFeature that should be placed by this PlacedFeature via its ResourceLocation. If the ConfiguredFeature is not yet registered, an empty Holder will be created and the ConfiguredFeature will be set later by the ConfiguredFeature Registry.

fun configuredFeature(configuredFeature: ConfiguredFeature<*, *>)

Sets the ConfiguredFeature that should be placed by this PlacedFeature.

Link copied to clipboard
fun count(count: Int)

Adds a CountPlacement with the given count to this PlacedFeature, which returns the given position count times.

fun count(count: IntProvider)

Adds a CountPlacement with the given count to this PlacedFeature, which returns the given position count times. The IntProvider is sampled for each position.

Link copied to clipboard
fun countOnEveryLayer(count: IntProvider)
Link copied to clipboard
fun environmentScan(direction: Direction, target: BlockPredicate, maxSteps: Int)

Adds an EnvironmentScanPlacement to this PlacedFeature, which scans for blocks matching the given target BlockPredicate up/down until it finds a matching block or the max number of steps is reached. If no matching block is found, empty is returned.

fun environmentScan(direction: Direction, target: BlockPredicate, continuePredicate: BlockPredicate, maxSteps: Int)

Adds an EnvironmentScanPlacement to this PlacedFeature, which scans for blocks matching the given target BlockPredicate up/down until it finds a matching block, the max number of steps is reached or the continuePredicate not matching the next block. If no matching block is found, empty is returned.

Link copied to clipboard
fun heightMap(heightmap: Heightmap.Types)

Adds a HeightmapPlacement with the given heightmap to this PlacedFeature, which takes the input position and sets the y coordinate to one block above the heightmap at the given position.

Link copied to clipboard
fun heightRange(provider: HeightProvider)

Adds a HeightRangePlacement with the given provider to this PlacedFeature, which takes the input position and sets the y-coordinate to a value provided by the given HeightProvider.

Link copied to clipboard
fun heightRangeTriangle(min: VerticalAnchor, max: VerticalAnchor)

Adds a HeightRangePlacement with a trapezoid HeightProvider and a plateau of 0.

Link copied to clipboard
fun heightRangeUniform(min: VerticalAnchor, max: VerticalAnchor)

Adds a HeightRangePlacement with a uniform distribution between min and max.

Link copied to clipboard

Adds a InSquarePlacement to this PlacedFeature, which adds a random integer in the range [0; 15] to the x- and z-coordinates of the given position.

Link copied to clipboard

Adds a HeightRangePlacement with a uniform distribution between the min y-level and the max terrain height.

Link copied to clipboard
fun modifier(modifier: PlacementModifier)

Adds a PlacementModifier to this PlacedFeature.

Link copied to clipboard
fun modifiers(vararg modifiers: PlacementModifier)
fun modifiers(modifiers: Collection<PlacementModifier>)

Adds multiple PlacementModifiers to this PlacedFeature.

Link copied to clipboard

Adds a HeightmapPlacement with the Heightmap.Types.MOTION_BLOCKING heightmap to this PlacedFeature, which takes the input position and sets the y coordinate to one block above the heightmap at the given position.

Link copied to clipboard

Adds a HeightmapPlacement with the Heightmap.Types.OCEAN_FLOOR heightmap to this PlacedFeature, which takes the input position and sets the y coordinate to one block above the heightmap at the given position.

Link copied to clipboard

Adds a HeightmapPlacement with the Heightmap.Types.OCEAN_FLOOR_WG heightmap to this PlacedFeature, which takes the input position and sets the y coordinate to one block above the heightmap at the given position.

Link copied to clipboard

Adds a HeightmapPlacement with the Heightmap.Types.WORLD_SURFACE_WG heightmap to this PlacedFeature, which takes the input position and sets the y coordinate to one block above the heightmap at the given position.

Link copied to clipboard
fun noiseBasedCount(noiseToCountRatio: Int, noiseFactor: Double, noiseOffset: Double)
Link copied to clipboard
fun noiseThresholdCount(noiseLevel: Double, belowNoise: Int, aboveNoise: Int)

Adds a NoiseThresholdCountPlacement with the given noiseLevel, belowNoise and aboveNoise values to this PlacedFeature, which gets the noise value at the given position and, if the value is positive, returns the given position multiple times.

Link copied to clipboard

Adds a RandomOffsetPlacement with a ySpread value of 0 and the given xzSpread value to this PlacedFeature, which offsets the x- and z-coordinates of the given position by the provided value.

fun randomHorizontalOffset(xzSpread: IntProvider)

Adds a RandomOffsetPlacement with a ySpread value of 0 and the given xzSpread value to this PlacedFeature, which offsets the x- and z-coordinates of the given position by the provided IntProvider's value. Please note, that the xzSpread is sampled separately for the x- and z-coordinates.

Link copied to clipboard
fun randomOffset(xzSpread: Int, ySpread: Int)

Adds a RandomOffsetPlacement with the given xzSpread and ySpread values to this PlacedFeature, which offsets the given position by the provided values.

fun randomOffset(xzSpread: IntProvider, ySpread: IntProvider)

Adds a RandomOffsetPlacement with the given xzSpread and ySpread values to this PlacedFeature, which offsets the given position by the provided IntProvider's value. Please note, that the xzSpread is sampled separately for the x- and z-coordinates.

Link copied to clipboard

Adds a RandomOffsetPlacement with a xzSpread value of 0 and the given ySpread value to this PlacedFeature, which offsets the y-coordinate of the given position by the provided value.

fun randomVerticalOffset(ySpread: IntProvider)

Adds a RandomOffsetPlacement with a xzSpread value of 0 and the given ySpread value to this PlacedFeature, which offsets the y-coordinate of the given position by the provided IntProvider's value.

Link copied to clipboard
fun rarityFilter(onAverageOnceEvery: Int)

Adds a RarityFilter to this PlacedFeature, which returns the given position with a probability of 1 / onAverageOnceEvery.

Link copied to clipboard
fun surfaceRelativeThresholdFilter(heightmap: Heightmap.Types, min: Int, max: Int)

Adds a SurfaceRelativeThresholdFilter with the given heightmap, min and max values to this PlacedFeature, which returns the given position if the surface height at the given position is inside the specified range. Otherwise, returns empty.

Link copied to clipboard

Adds a SurfaceWaterDepthFilter with the given maxDepth value to this PlacedFeature, which only returns the given position if the amount of motion-blocking blocks under the surface is less than/equal to maxDepth.