Placed Features
A PlacedFeature is a
configured feature together with a list of placement modifiers that decide where,
how often, and under what conditions it should generate.
A placed feature is either a reference to one already registered or a custom authored one.
Referencing Built-in Placed Features
Section titled “Referencing Built-in Placed Features”The PlacedFeatures catalog holds typed
references to every placeable vanilla feature.
import me.outspending.biomesapi.wrapper.worldgen.placement.PlacedFeature;
import me.outspending.biomesapi.wrapper.worldgen.placement.PlacedFeatures;
PlacedFeature diamonds = PlacedFeatures.ORE_DIAMOND; Authoring a Placed Feature
Section titled “Authoring a Placed Feature”To author one, pass a configured feature and the placement modifiers that position it.
import me.outspending.biomesapi.wrapper.worldgen.HeightmapType;
import me.outspending.biomesapi.wrapper.worldgen.PlacementModifier;
import me.outspending.biomesapi.wrapper.worldgen.feature.ConfiguredFeatures;
import me.outspending.biomesapi.wrapper.worldgen.placement.PlacedFeature;
PlacedFeature flowers = PlacedFeature.of(
ConfiguredFeatures.FLOWER_DEFAULT,
PlacementModifier.rarityFilter(8),
PlacementModifier.inSquare(),
PlacementModifier.heightmap(HeightmapType.MOTION_BLOCKING),
PlacementModifier.biomeFilter()
); Placement Modifiers
Section titled “Placement Modifiers”Placement modifiers run in order, each transforming the set of positions the feature will generate at.
Such as:
/count(n)count(IntProvider): generate the feature a fixed or variable number of times per chunk.rarityFilter(n): generate on average once everynchunks.inSquare(): spread the position randomly within the chunk.heightmap(HeightmapType): place at the surface height of the given heightmap.heightRangeUniform(...)/heightRangeTriangle(...): choose a Y within a vertical range.biomeFilter(): only generate if the target biome matches. Almost always added last.