Skip to content

Value Providers

World generation rarely uses plain numbers. Rather, we use value providers, small objects that produce a number, a height, or a vertical position, sometimes randomly.

A VerticalAnchor describes a single Y position relative to the world.

ExamplePlugin.java Java
import me.outspending.biomesapi.wrapper.worldgen.valueproviders.VerticalAnchor;

  VerticalAnchor.absolute(64); // exactly Y=64
  VerticalAnchor.aboveBottom(8); // 8 blocks above the world's minimum height
  VerticalAnchor.belowTop(1); // 1 block below the world's maximum height

An IntProvider produces an integer, either constant or sampled from a distribution.

ExamplePlugin.java Java
import me.outspending.biomesapi.wrapper.worldgen.valueproviders.IntProvider;

  IntProvider.constant(4); // always 4
  IntProvider.uniform(2, 8); // evenly between 2 and 8
  IntProvider.triangle(6); // triangular distribution centered with spread 6

A FloatProvider is the floating-point equivalent, used for radii, scales, and probabilities inside carvers and features.

ExamplePlugin.java Java
import me.outspending.biomesapi.wrapper.worldgen.valueproviders.FloatProvider;

  FloatProvider.constant(3.0f); // always 3.0
  FloatProvider.uniform(0.1f, 0.9f); // evenly between 0.1 and 0.9
  FloatProvider.trapezoid(0.0f, 6.0f, 2.0f); // trapezoidal distribution

A HeightProvider produces a Y position by combining vertical anchors.

ExamplePlugin.java Java
import me.outspending.biomesapi.wrapper.worldgen.valueproviders.HeightProvider;
import me.outspending.biomesapi.wrapper.worldgen.valueproviders.VerticalAnchor;

HeightProvider.uniform(VerticalAnchor.aboveBottom(8), VerticalAnchor.absolute(180));
HeightProvider.trapezoid(VerticalAnchor.absolute(0), VerticalAnchor.absolute(128), 0);