Skip to content

Carvers

Carvers are responsible for ‘carving’ out areas of a world to create caves, canyons, ravines, and other underground features.

A ConfiguredWorldCarver is either a reference to a carver already in the game, or a custom carver you may author from a carver type and a configuration. Both are added to a biome through its generation settings.

The Carvers catalog holds typed references to every vanilla carver.

ExamplePlugin.java Java
import me.outspending.biomesapi.wrapper.worldgen.BiomeGenerationSettings;
import me.outspending.biomesapi.wrapper.worldgen.carver.Carvers;

BiomeGenerationSettings generation = BiomeGenerationSettings.builder()
  .addCarver(Carvers.CAVE)
  .addCarver(Carvers.CANYON)
  .build();

To author your own, pair a carver type with a configuration.

Java
import me.outspending.biomesapi.wrapper.worldgen.carver.CaveCarverConfiguration;
import me.outspending.biomesapi.wrapper.worldgen.carver.ConfiguredWorldCarver;
import me.outspending.biomesapi.wrapper.worldgen.valueproviders.FloatProvider;
import me.outspending.biomesapi.wrapper.worldgen.valueproviders.HeightProvider;
import me.outspending.biomesapi.wrapper.worldgen.valueproviders.VerticalAnchor;
import org.bukkit.Material;

import java.util.List;

ConfiguredWorldCarver cave = ConfiguredWorldCarver.cave(
  CaveCarverConfiguration.builder()
      .probability(0.15f)
      .y(HeightProvider.uniform(VerticalAnchor.aboveBottom(8), VerticalAnchor.absolute(180)))
      .yScale(FloatProvider.uniform(0.1f, 0.9f))
      .lavaLevel(VerticalAnchor.aboveBottom(8))
      .replaceable(List.of(Material.STONE, Material.DEEPSLATE))
      .horizontalRadiusMultiplier(FloatProvider.uniform(0.7f, 1.4f))
      .verticalRadiusMultiplier(FloatProvider.uniform(0.8f, 1.3f))
      .floorLevel(FloatProvider.uniform(-1.0f, -0.4f))
      .build()
);