The absolute value of input. Turns a noise into sharp ridges along its zero line.
Abs(input) inputDensityFunctionRef
Helpers that build a minecraft:density_function object, one for each of its types. Where a field takes one, write the helper's call; its
name is the type it makes. Click a type to see what it accepts.
The absolute value of input. Turns a noise into sharp ridges along its zero line.
Abs(input) inputDensityFunctionRef left + right. Usually written with +.
Add(left, right) leftDensityFunctionRef rightDensityFunctionRef DensityFunction raised = Noise(minecraft:ridge, 1, 0) + 0.2Adds density around structures that adapt the terrain, such as villages and ancient cities. Vanilla adds it to final_density.
Beardifier() Blending with chunks from before 1.18: 1 in new chunks, lower near old ones.
BlendAlpha() Blends input with the terrain of chunks from before 1.18. In new chunks it is input unchanged.
BlendDensity(input) inputDensityFunctionRef Computes input once per position, for a function used in several places. The value is unchanged.
Cache(input) inputDensityFunctionRef Rounds input up to a whole multiple of multiple.
Ceil(input, multiple?) inputDensityFunctionRef multipleoptionalDensityFunctionRef Defaults to constant 1.
Keeps input between min and max.
Clamp(input, min, max) inputDensityFunctionRef minNoiseRange The lowest value let through.
maxNoiseRange The highest value let through.
DensityFunction capped = Clamp(Noise(minecraft:ridge, 1, 1), -0.5, 0.5)The same number everywhere. A plain number does the same thing.
Constant(value) valueNoiseRange The number.
DensityFunction half = Constant(0.5)input * input * input. Keeps the sign and flattens values near 0.
Cube(input) inputDensityFunctionRef left / right. Usually written with /.
Div(left, right) leftDensityFunctionRef rightDensityFunctionRef The End's island terrain: the main island in the middle, and scattered islands beyond 1024 blocks.
EndOuterIslands() FindTopSurface(density, upper_bound, lower_bound, cell_height) densityDensityFunctionRef upper_boundDensityFunctionRef lower_boundint -4064..4062 cell_heightint 1.. Rounds input down to a whole multiple of multiple. Rounding a gradient makes terraces.
Floor(input, multiple?) inputDensityFunctionRef multipleoptionalDensityFunctionRef Defaults to constant 1.
Changes linearly along one axis: from_value at from_coordinate, to_value at to_coordinate. Beyond the two coordinates it holds the end values, unless tiling says otherwise. Use it to make terrain solid at the bottom and air at the top.
Gradient(axis, from_coordinate, to_coordinate, from_value, to_value, tiling?) axisAxis The axis the gradient runs along: x, y or z.
from_coordinateany (depends on axis) Where the gradient starts, in blocks.
to_coordinateany (depends on axis) Where the gradient ends, in blocks.
from_valueNoiseRange The value at from_coordinate.
to_valueNoiseRange The value at to_coordinate.
tilingoptionalTilingMode What happens beyond the two coordinates: clamp_to_edge holds the end values, repeat starts over, mirrored_repeat runs back and forth. Defaults to clamp_to_edge.
DensityFunction ground = Gradient(
axis = y,
from_coordinate = 0,
to_coordinate = 128,
from_value = 1,
to_value = -1,
)input, with negative values halved. Vanilla uses it to soften cave walls.
HalfNegative(input) inputDensityFunctionRef Computes input only at the corners of cells and blends between them. Smoother and much faster than sampling every block; vanilla wraps its terrain in it.
Interpolated(input, cell_size_xz, cell_size_y) inputDensityFunctionRef The function to interpolate.
cell_size_xzint 1.. Cell width, in blocks.
cell_size_yint 1.. Cell height, in blocks.
Picks one of functions by which interval of thresholds the value of input falls in: below the first threshold picks the first function, and so on.
IntervalSelect(input, thresholds, functions) inputDensityFunctionRef thresholdslist of NoiseRange (at least 1) Must have exactly one fewer element than functions.
functionslist of DensityFunctionRef (at least 2) Must have exactly one more element than thresholds.
Blends from first to second by alpha: first where alpha is 0, second where it is 1.
Lerp(alpha, first, second) alphaDensityFunctionRef How far to blend, usually from 0 to 1.
firstDensityFunctionRef The value where alpha is 0.
secondDensityFunctionRef The value where alpha is 1.
The larger of the two inputs. Max(a, b) joins two terrains.
Max(left, right) leftDensityFunctionRef rightDensityFunctionRef DensityFunction both = Max(Noise(minecraft:ridge, 1, 0), Noise(minecraft:jagged, 1, 0))The smaller of the two inputs. Min(a, b) keeps the lower of two terrains.
Min(left, right) leftDensityFunctionRef rightDensityFunctionRef left * right. Usually written with *. Vanilla stops computing right where left is 0.
Mul(left, right) leftDensityFunctionRef rightDensityFunctionRef Samples a noise at the block's position, scaled per axis. The result is roughly between -1 and 1. Most terrain starts here.
Noise(noise, xz_scale, y_scale, shift_x?, shift_y?, shift_z?) noiseNoiseParametersRef The noise, by id: a Noise declaration or a vanilla one such as minecraft:ridge.
xz_scalenumber Multiplies x and z before sampling. Below 1 stretches the noise out horizontally; above 1 squeezes it.
y_scalenumber Multiplies y before sampling. 0 makes the noise the same at every height (2D).
shift_xoptionalDensityFunctionRef Added to x before sampling, so the noise doesn't line up with others. Vanilla uses ShiftA. Defaults to constant 0.
shift_yoptionalDensityFunctionRef Added to y before sampling. Defaults to constant 0.
shift_zoptionalDensityFunctionRef Added to z before sampling. Vanilla uses ShiftB. Defaults to constant 0.
Noise hills { base_octave = -7, amplitude_modifiers = [1, 1] }
DensityFunction land = Noise(hills, 1, 0) * 0.5The 3D terrain noise from before 1.18, which vanilla still uses as the base of overworld and nether terrain.
OldBlendedNoise(xz_scale, y_scale, xz_factor, y_factor, smear_scale_multiplier) xz_scalenumber y_scalenumber xz_factornumber y_factornumber smear_scale_multipliernumber 1..8 base raised to the power exponent.
Pow(base, exponent) baseDensityFunctionRef exponentDensityFunctionRef Picks between two functions by the value of input: when_in_range where min_inclusive <= input < max_exclusive, when_out_of_range elsewhere. Only the chosen one is computed.
RangeChoice(input, min_inclusive, max_exclusive, when_in_range, when_out_of_range) inputDensityFunctionRef The value to test.
min_inclusiveNoiseRange The lowest value that counts as in range.
max_exclusiveNoiseRange The value above the range; it counts as out of range.
when_in_rangeDensityFunctionRef Used where input is in range.
when_out_of_rangeDensityFunctionRef Used everywhere else.
Rounds input to the nearest whole multiple of multiple.
Round(input, multiple?) inputDensityFunctionRef multipleoptionalDensityFunctionRef Defaults to constant 1.
Samples noise at a quarter of the block's x, y and z and multiplies it by 4. Used as a shift for another noise.
Shift(noise) noiseNoiseParametersRef Samples noise at a quarter of the block's x and z (y is 0) and multiplies it by 4. Vanilla uses it as shift_x of its climate noises.
ShiftA(noise) noiseNoiseParametersRef Like ShiftA, with x and z swapped. Vanilla uses it as shift_z of its climate noises.
ShiftB(noise) noiseNoiseParametersRef Maps a value through a cubic spline: a curve through points, each with a location, a value and a derivative. Vanilla shapes continents, erosion and peaks into terrain height with splines.
Spline(spline) splineCubicSpline Clamps input to -1..1, then bends it to x / 2 - x³ / 24. Vanilla applies it near the end of final_density to smooth sharp values.
Squeeze(input) inputDensityFunctionRef left - right. Usually written with -.
Sub(left, right) leftDensityFunctionRef rightDensityFunctionRef Rounds input toward zero, to a whole multiple of multiple.
Truncate(input, multiple?) inputDensityFunctionRef multipleoptionalDensityFunctionRef Defaults to constant 1.