Interface PlacementModifier
- All Superinterfaces:
Wrapper
- All Known Implementing Classes:
PlacementModifier.BiomeFilter, PlacementModifier.BlockPredicateFilter, PlacementModifier.CountPlacement, PlacementModifier.EnvironmentScanPlacement, PlacementModifier.FixedPlacement, PlacementModifier.HeightmapPlacement, PlacementModifier.HeightRangePlacement, PlacementModifier.InSquarePlacement, PlacementModifier.NoiseBasedCountPlacement, PlacementModifier.NoiseThresholdCountPlacement, PlacementModifier.RandomOffsetPlacement, PlacementModifier.RarityFilter, PlacementModifier.SurfaceRelativeThresholdFilter, PlacementModifier.SurfaceWaterDepthFilter
@NullMarked
@AsOf("2.3.0")
public sealed interface PlacementModifier
extends Wrapper
permits PlacementModifier.BiomeFilter, PlacementModifier.BlockPredicateFilter, PlacementModifier.CountPlacement, PlacementModifier.EnvironmentScanPlacement, PlacementModifier.FixedPlacement, PlacementModifier.HeightRangePlacement, PlacementModifier.HeightmapPlacement, PlacementModifier.InSquarePlacement, PlacementModifier.NoiseBasedCountPlacement, PlacementModifier.NoiseThresholdCountPlacement, PlacementModifier.RandomOffsetPlacement, PlacementModifier.RarityFilter, PlacementModifier.SurfaceRelativeThresholdFilter, PlacementModifier.SurfaceWaterDepthFilter
Wraps the PlacementModifier family, the ordered transforms applied to
a feature's candidate positions during placement.
- Since:
- 2.3.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordstatic final recordstatic final recordstatic final recordstatic interfacestatic final recordstatic final recordstatic final recordstatic final recordstatic final recordstatic final recordstatic final recordstatic final recordstatic final recordstatic final recordNested classes/interfaces inherited from interface Wrapper
Wrapper.Context<C> -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic PlacementModifierCreates a placement modifier that filters positions based on the biome.static PlacementModifierblockPredicateFilter(BlockPredicate predicate) Keeps positions that satisfy the given block predicate.static PlacementModifiercount(int count) Repeats placement a fixed number of times.static PlacementModifiercount(IntProvider count) Repeats placement a number of times sampled from the count provider.static PlacementModifierenvironmentScan(BlockFace directionOfSearch, BlockPredicate targetCondition, int maxSteps) Scans vertically for a target condition, allowing the default search condition.static PlacementModifierenvironmentScan(BlockFace directionOfSearch, BlockPredicate targetCondition, BlockPredicate allowedSearchCondition, int maxSteps) Scans vertically for a target condition while an allowed search condition holds.static PlacementModifierfixedPlacement(BlockVector... positions) Creates a fixed placement modifier that defines positions where blocks or features will be placed.static PlacementModifierheightmap(HeightmapType heightmap) Creates a placement modifier that filters positions based on a specified heightmap type.static PlacementModifierheightRange(HeightProvider height) Creates a placement modifier that defines a range of vertical heights where placement is allowed.static PlacementModifierheightRangeTriangle(VerticalAnchor minInclusive, VerticalAnchor maxInclusive) Creates a height range placement modifier using a triangular distribution between the specified minimum and maximum vertical anchors.static PlacementModifierheightRangeUniform(VerticalAnchor minInclusive, VerticalAnchor maxInclusive) Creates a PlacementModifier that defines a uniform height range for placement between the specified minimum and maximum vertical anchors, inclusive.static PlacementModifierinSquare()Creates a placement modifier that ensures placement occurs within a square grid.static PlacementModifiernoiseBasedCount(int noiseToCountRatio, double noiseFactor, double noiseOffset) Creates a placement modifier that selects positions based on noise settings.static PlacementModifiernoiseThresholdCount(double noiseLevel, int belowNoise, int aboveNoise) Creates a placement modifier that adjusts placement based on a noise threshold.static PlacementModifierrandomOffset(IntProvider xzSpread, IntProvider ySpread) Randomly offsets the position by the given spreads.static PlacementModifierrandomOffsetHorizontal(IntProvider xzSpread) Randomly offsets the position horizontally only.static PlacementModifierrandomOffsetTriangle(int xzRange, int yRange) Randomly offsets the position using triangular spreads over the given ranges.static PlacementModifierrandomOffsetVertical(IntProvider ySpread) Randomly offsets the position vertically only.static PlacementModifierrarityFilter(int chance) Filters a position based on a specified chance value, allowing positions to be kept with a probability of 1/chance.static PlacementModifiersurfaceRelativeThreshold(HeightmapType heightmap, int minInclusive, int maxInclusive) Creates a placement modifier that filters positions based on their relative surface height using the specified heightmap type and a range of inclusive minimum and maximum height thresholds.static PlacementModifiersurfaceWaterDepth(int maxWaterDepth) Creates a placement modifier that filters positions based on their surface water depth.default ObjectConvert this handle to the real Minecraft object.
-
Field Details
-
WIRE
-
-
Method Details
-
biomeFilter
Creates a placement modifier that filters positions based on the biome.- Returns:
- a biome filter placement modifier
- Since:
- 2.3.0
-
inSquare
Creates a placement modifier that ensures placement occurs within a square grid.- Returns:
- a placement modifier configured for square-based placement
- Since:
- 2.3.0
-
rarityFilter
Filters a position based on a specified chance value, allowing positions to be kept with a probability of 1/chance.- Parameters:
chance- the probability denominator which determines how likely a position is to be kept and must be greater than 0- Returns:
- a placement modifier that applies the rarity filter
- Since:
- 2.3.0
-
surfaceWaterDepth
Creates a placement modifier that filters positions based on their surface water depth.- Parameters:
maxWaterDepth- the maximum depth of water allowed on the surface for a position to pass the filter- Returns:
- a surface water depth placement modifier
- Since:
- 2.3.0
-
noiseBasedCount
@AsOf("2.3.0") static PlacementModifier noiseBasedCount(int noiseToCountRatio, double noiseFactor, double noiseOffset) Creates a placement modifier that selects positions based on noise settings.- Parameters:
noiseToCountRatio- the ratio between noise value and count, influencing placement densitynoiseFactor- the multiplier applied to the noise value for scalingnoiseOffset- the constant offset added to the noise value for adjustment- Returns:
- a placement modifier that applies noise-based distribution logic
- Since:
- 2.3.0
-
noiseThresholdCount
@AsOf("2.3.0") static PlacementModifier noiseThresholdCount(double noiseLevel, int belowNoise, int aboveNoise) Creates a placement modifier that adjusts placement based on a noise threshold. Positions are selected based on whether the noise value at a position is above or below the specified threshold, determining the count of positions to retain.- Parameters:
noiseLevel- the noise level threshold used to decide placementbelowNoise- the number of placements to retain when the noise level is below the thresholdaboveNoise- the number of placements to retain when the noise level is above the threshold- Returns:
- a placement modifier configured for noise-based threshold placement
- Since:
- 2.3.0
-
heightmap
Creates a placement modifier that filters positions based on a specified heightmap type.- Parameters:
heightmap- the type of heightmap to use for filtering positions- Returns:
- a placement modifier configured to use the specified heightmap type
- Since:
- 2.3.0
-
surfaceRelativeThreshold
@AsOf("2.3.0") static PlacementModifier surfaceRelativeThreshold(HeightmapType heightmap, int minInclusive, int maxInclusive) Creates a placement modifier that filters positions based on their relative surface height using the specified heightmap type and a range of inclusive minimum and maximum height thresholds. Positions are retained if they fall within the given range on the specified heightmap.- Parameters:
heightmap- the type of heightmap to use for filtering positionsminInclusive- the inclusive minimum height threshold for filteringmaxInclusive- the inclusive maximum height threshold for filtering- Returns:
- a placement modifier that applies the surface-relative height threshold filter
- Since:
- 2.3.0
-
heightRange
Creates a placement modifier that defines a range of vertical heights where placement is allowed.- Parameters:
height- the height provider that specifies the inclusive minimum and maximum vertical bounds- Returns:
- a placement modifier configured for height-based placement within the specified range
- Since:
- 2.3.0
-
heightRangeUniform
@AsOf("2.3.0") static PlacementModifier heightRangeUniform(VerticalAnchor minInclusive, VerticalAnchor maxInclusive) Creates a PlacementModifier that defines a uniform height range for placement between the specified minimum and maximum vertical anchors, inclusive.- Parameters:
minInclusive- the minimum vertical anchor for the placement range, inclusivemaxInclusive- the maximum vertical anchor for the placement range, inclusive- Returns:
- a PlacementModifier that applies a uniform height placement between the given bounds
- Since:
- 2.3.0
-
heightRangeTriangle
@AsOf("2.3.0") static PlacementModifier heightRangeTriangle(VerticalAnchor minInclusive, VerticalAnchor maxInclusive) Creates a height range placement modifier using a triangular distribution between the specified minimum and maximum vertical anchors. The distribution will favor heights closer to midpoints within the range.- Parameters:
minInclusive- the minimum vertical anchor, inclusivemaxInclusive- the maximum vertical anchor, inclusive- Returns:
- a PlacementModifier that represents a triangular height range placement
- Since:
- 2.3.0
-
fixedPlacement
Creates a fixed placement modifier that defines positions where blocks or features will be placed.- Parameters:
positions- an array of BlockVector objects representing the fixed positions for placement- Returns:
- a PlacementModifier that applies the fixed placement defined by the specified positions
- Since:
- 2.3.0
-
count
Repeats placement a number of times sampled from the count provider.- Parameters:
count- the count provider- Returns:
- a count placement modifier
- Since:
- 2.3.0
-
count
Repeats placement a fixed number of times.- Parameters:
count- the fixed count- Returns:
- a count placement modifier
- Since:
- 2.3.0
-
randomOffset
Randomly offsets the position by the given spreads.- Parameters:
xzSpread- the horizontal spread providerySpread- the vertical spread provider- Returns:
- a random offset placement modifier
- Since:
- 2.3.0
-
randomOffsetVertical
Randomly offsets the position vertically only.- Parameters:
ySpread- the vertical spread provider- Returns:
- a random offset placement modifier
- Since:
- 2.3.0
-
randomOffsetHorizontal
Randomly offsets the position horizontally only.- Parameters:
xzSpread- the horizontal spread provider- Returns:
- a random offset placement modifier
- Since:
- 2.3.0
-
randomOffsetTriangle
Randomly offsets the position using triangular spreads over the given ranges.- Parameters:
xzRange- the horizontal rangeyRange- the vertical range- Returns:
- a random offset placement modifier
- Since:
- 2.3.0
-
blockPredicateFilter
Keeps positions that satisfy the given block predicate.- Parameters:
predicate- the predicate to test- Returns:
- a block predicate filter modifier
- Since:
- 2.3.0
-
environmentScan
@AsOf("2.3.0") static PlacementModifier environmentScan(BlockFace directionOfSearch, BlockPredicate targetCondition, int maxSteps) Scans vertically for a target condition, allowing the default search condition.- Parameters:
directionOfSearch- the vertical search direction (UP or DOWN)targetCondition- the condition the scan is looking formaxSteps- the maximum number of steps, in [1, 32]- Returns:
- an environment scan placement modifier
- Since:
- 2.3.0
-
environmentScan
@AsOf("2.3.0") static PlacementModifier environmentScan(BlockFace directionOfSearch, BlockPredicate targetCondition, BlockPredicate allowedSearchCondition, int maxSteps) Scans vertically for a target condition while an allowed search condition holds.- Parameters:
directionOfSearch- the vertical search direction (UP or DOWN)targetCondition- the condition the scan is looking forallowedSearchCondition- the condition that must hold to keep scanningmaxSteps- the maximum number of steps, in [1, 32]- Returns:
- an environment scan placement modifier
- Since:
- 2.3.0
-
toMinecraft
Description copied from interface:WrapperConvert this handle to the real Minecraft object.- Specified by:
toMinecraftin interfaceWrapper- Returns:
- the real Minecraft object
-