Height Providers
Height providers are used to get a height value for a given position. Before we can get into the details however, we first
need to take a look at VerticalAnchors
.
Vertical Anchors
Vertical anchors are used to get a fixed height value depending on factors like the min and max build height. There is of course also a constant implementation that always returns the same value. Please note that the type doesn't have to be specified in Json. It's automatically inferred via the key name.
Warning
All specified values need to be within the the min and max build height of the world.
absolute
Always returns the same y-value.
above_bottom
Returns a y-value above the min build height of the world by above_bottom
blocks.
below_top
Returns a y-value below the max build height of the world by below_top
blocks.
Vanilla Height Providers
minecraft:constant
Always returns the y-value provided by a vertical anchor.
value
-
The vertical anchor to use.
minecraft:uniform
Generates a random y-value between min_inclusive
and max_inclusive
in a uniform distribution.
min_inclusive
-
A vertical anchor that specifies the minimum y-value.
max_inclusive
-
A vertical anchor that specifies the maximum y-value.
minecraft:biased_to_bottom
/minecraft:very_biased_to_bottom
Generates a random y-value between min_inclusive
and max_inclusive
with bias towards the minimum.
min_inclusive
-
A vertical anchor that specifies the minimum y-value.
max_inclusive
-
A vertical anchor that specifies the maximum y-value.
inner
(Optional in Json)-
The higher this value is, the more biased the distribution is towards the minimum. Defaults to
0
.
minecraft:trapezoid
Generates a random y-value between min_inclusive
and max_inclusive
with a trapezoidal distribution.
The Minecraft Wiki explains its usage in ore generation pretty well:
min_inclusive
-
A vertical anchor that specifies the minimum y-value.
max_inclusive
-
A vertical anchor that specifies the maximum y-value.
plateau
(optional)-
The length of the range in the middle of the trapezoid that has a uniform distribution. Defaults to
0
.
minecraft:weighted_list
Generates a random y-value based on a weighted list of other height providers.
distribution
-
A list of height providers and their weights (Can't be empty).
data
is the actual height provider andweight
is the weight of the provider.
Inline VerticalAnchors
If none of the vanilla VerticalAnchors
fit your needs, you can also inline your own VerticalAnchor
via lambdas: