dev.polymodloader.api.worldgen
This page is generated from the source's Javadoc by ./gradlew apiReference. Do not edit it; fix the source comment and generate it again.
| Type | Kind | Description |
|---|---|---|
BiomeDefinition | record | A biome defined in code. |
BiomeDefinition.Builder | class | Builds a BiomeDefinition. |
BiomeSelector | interface | Chooses biomes: by ID, or by biome tag such as minecraft:is_overworld. |
BiomeSelector.ById | record | — |
BiomeSelector.ByTag | record | — |
BiomeSpawn | record | A mob that spawns in a code-defined biome. |
CodeFeature | functional interface | A placed feature written in code: a boulder, a plant patch, an ore cluster with a custom shape. |
ColumnBuilder | interface | One block column being generated; valid only during TerrainGenerator.fillColumn. |
FeatureContext | interface | Where and with what a CodeFeature places blocks, valid only during CodeFeature.place. |
FeaturePlacement | record | Where a CodeFeature is tried in each chunk: how often, and at which height. |
GenerationStepName | enum | The feature placement steps of world generation, in the order the game runs them. |
NoiseFunction | functional interface | A density value per block position, used inside the game's noise terrain as a density function (WorldgenRegistrar.densityFunction). |
StructureBuilder | functional interface | Builds a code structure's blocks into its box. |
StructureDefinition | record | A structure built in code: a box placed on the terrain surface at the centre of chosen chunks, filled by a StructureBuilder. |
StructureDefinition.Builder | class | Builds a StructureDefinition. |
StructurePieceContext | interface | The box a StructureBuilder builds in, valid only during StructureBuilder.build. |
TerrainGenerator | functional interface | Terrain written in code: fills each block column of new chunks. |
WorldgenRegistrar | interface | Changes world generation. |
BiomeDefinition
record · Stability PREVIEW · Since 0.1.0-alpha.4 or earlier
public record BiomeDefinition(float temperature, float downfall, boolean precipitation, int skyColor, Optional<Integer> fogColor, int waterColor, Optional<Integer> grassColor, Optional<Integer> foliageColor, Map<GenerationStepName,List<ResourceId>> features, List<BiomeSpawn> spawns)
A biome defined in code. Poly Mod Loader writes it as biome data into its generated data pack, so it behaves exactly like a biome from a data pack: dimensions, biome tags, and /locate biome see it. Colours are 0xRRGGBB.
| Component | Type | Description |
|---|---|---|
temperature | float | affects snow and grass colour (plains 0.8, snowy plains 0.0) |
downfall | float | affects grass and foliage colour (plains 0.4) |
precipitation | boolean | whether it rains (or snows when cold) |
skyColor | int | sky colour |
fogColor | Optional<Integer> | fog colour, or the game's default |
waterColor | int | water colour (plains 0x3f76e4) |
grassColor | Optional<Integer> | grass colour, or computed from temperature and downfall |
foliageColor | Optional<Integer> | leaf colour, or computed |
features | Map<GenerationStepName,List<ResourceId>> | placed features per generation step |
spawns | List<BiomeSpawn> | mobs that spawn naturally |
builder()
public static BiomeDefinition.Builder builder()
Since 0.1.0-alpha.4 or earlier
A builder with plains-like values and no features or spawns.
Returns BiomeDefinition.Builder
BiomeDefinition.Builder
class · Since 0.1.0-alpha.4 or earlier
public static final class Builder
Builds a BiomeDefinition.
climate(float, float, boolean)
public BiomeDefinition.Builder climate(float temperature, float downfall, boolean precipitation)
Since 0.1.0-alpha.4 or earlier
Temperature (plains 0.8), downfall (plains 0.4) and whether it rains or snows.
| Parameter | Type | Description |
|---|---|---|
temperature | float | — |
downfall | float | — |
precipitation | boolean | — |
Returns BiomeDefinition.Builder
skyColor(int)
public BiomeDefinition.Builder skyColor(int color)
Since 0.1.0-alpha.4 or earlier
Sky colour, 0xRRGGBB.
| Parameter | Type | Description |
|---|---|---|
color | int | — |
Returns BiomeDefinition.Builder
fogColor(int)
public BiomeDefinition.Builder fogColor(int color)
Since 0.1.0-alpha.4 or earlier
Fog colour, 0xRRGGBB.
| Parameter | Type | Description |
|---|---|---|
color | int | — |
Returns BiomeDefinition.Builder
waterColor(int)
public BiomeDefinition.Builder waterColor(int color)
Since 0.1.0-alpha.4 or earlier
Water colour, 0xRRGGBB.
| Parameter | Type | Description |
|---|---|---|
color | int | — |
Returns BiomeDefinition.Builder
grassColor(int)
public BiomeDefinition.Builder grassColor(int color)
Since 0.1.0-alpha.4 or earlier
Grass colour, 0xRRGGBB, instead of one computed from the climate.
| Parameter | Type | Description |
|---|---|---|
color | int | — |
Returns BiomeDefinition.Builder
foliageColor(int)
public BiomeDefinition.Builder foliageColor(int color)
Since 0.1.0-alpha.4 or earlier
Leaf colour, 0xRRGGBB, instead of one computed from the climate.
| Parameter | Type | Description |
|---|---|---|
color | int | — |
Returns BiomeDefinition.Builder
feature(GenerationStepName, ResourceId)
public BiomeDefinition.Builder feature(GenerationStepName step, ResourceId placedFeature)
Since 0.1.0-alpha.4 or earlier
Adds a placed feature, such as minecraft:trees_plains, in step.
| Parameter | Type | Description |
|---|---|---|
step | GenerationStepName | — |
placedFeature | ResourceId | — |
Returns BiomeDefinition.Builder
spawn(MobCategory, ResourceId, int, int, int)
public BiomeDefinition.Builder spawn(MobCategory category, ResourceId type, int weight, int minGroup, int maxGroup)
Since 0.1.0-alpha.4 or earlier
Adds a naturally spawning mob.
| Parameter | Type | Description |
|---|---|---|
category | MobCategory | — |
type | ResourceId | — |
weight | int | — |
minGroup | int | — |
maxGroup | int | — |
Returns BiomeDefinition.Builder
build()
public BiomeDefinition build()
Since 0.1.0-alpha.4 or earlier
Creates the definition.
Returns BiomeDefinition
BiomeSelector
interface · Stability PREVIEW · Since 0.1.0-alpha.4 or earlier
public sealed interface BiomeSelector
Chooses biomes: by ID, or by biome tag such as minecraft:is_overworld.
ids(ResourceId[])
static BiomeSelector ids(ResourceId... ids)
Since 0.1.0-alpha.4 or earlier
Biomes with one of these IDs.
| Parameter | Type | Description |
|---|---|---|
ids | ResourceId[] | — |
Returns BiomeSelector
tag(ResourceId)
static BiomeSelector tag(ResourceId tag)
Since 0.1.0-alpha.4 or earlier
Biomes in this tag.
| Parameter | Type | Description |
|---|---|---|
tag | ResourceId | — |
Returns BiomeSelector
BiomeSelector.ById
record · Since 0.1.0-alpha.4 or earlier
public static record ById(Set<ResourceId> ids) implements BiomeSelector
| Component | Type | Description |
|---|---|---|
ids | Set<ResourceId> | biome IDs |
Supertypes: BiomeSelector
BiomeSelector.ByTag
record · Since 0.1.0-alpha.4 or earlier
public static record ByTag(ResourceId tag) implements BiomeSelector
| Component | Type | Description |
|---|---|---|
tag | ResourceId | biome tag ID, without # |
Supertypes: BiomeSelector
BiomeSpawn
record · Stability PREVIEW · Since 0.1.0-alpha.4 or earlier
public record BiomeSpawn(MobCategory category, ResourceId type, int weight, int minGroup, int maxGroup)
A mob that spawns in a code-defined biome.
| Component | Type | Description |
|---|---|---|
category | MobCategory | spawn group |
type | ResourceId | entity type, for example minecraft:sheep |
weight | int | chance relative to other mobs of the category |
minGroup | int | smallest group |
maxGroup | int | largest group |
CodeFeature
functional interface · Stability PREVIEW · Since 0.1.0-alpha.4 or earlier
public interface CodeFeature
A placed feature written in code: a boulder, a plant patch, an ore cluster with a custom shape. Called on world generation threads while chunks generate, possibly for several chunks at once; keep all state in local variables and take randomness only from FeatureContext.random().
place(FeatureContext)
boolean place(FeatureContext context)
Since 0.1.0-alpha.4 or earlier
Places the feature around FeatureContext.origin().
| Parameter | Type | Description |
|---|---|---|
context | FeatureContext | — |
Returns boolean — whether anything was placed
ColumnBuilder
interface · Stability PREVIEW · Since 0.1.0-alpha.4 or earlier
public interface ColumnBuilder
One block column being generated; valid only during TerrainGenerator.fillColumn.
minY()
int minY()
Since 0.1.0-alpha.4 or earlier
Lowest Y of the dimension.
Returns int
maxY()
int maxY()
Since 0.1.0-alpha.4 or earlier
Highest Y of the dimension (inclusive).
Returns int
seed()
long seed()
Since 0.1.0-alpha.4 or earlier
A number derived from the world seed and the generator ID, the same for every column.
Returns long
set(int, ResourceId)
void set(int y, ResourceId block)
Since 0.1.0-alpha.4 or earlier
Sets the default state of block at y; positions outside the dimension are ignored.
| Parameter | Type | Description |
|---|---|---|
y | int | — |
block | ResourceId | — |
Throws IllegalArgumentException — for an unknown block
fill(int, int, ResourceId)
default void fill(int fromY, int toY, ResourceId block)
Since 0.1.0-alpha.4 or earlier
Sets block from fromY to toY, both inclusive.
| Parameter | Type | Description |
|---|---|---|
fromY | int | — |
toY | int | — |
block | ResourceId | — |
FeatureContext
interface · Stability PREVIEW · Since 0.1.0-alpha.4 or earlier
public interface FeatureContext
Where and with what a CodeFeature places blocks, valid only during CodeFeature.place. The world being generated is the chunk of the origin and its neighbours; keep blocks within 16 blocks of the origin horizontally. Positions are world coordinates.
origin()
BlockPos origin()
Since 0.1.0-alpha.4 or earlier
The position the placement chose, for example on the surface or at a random height.
Returns BlockPos
random()
RandomGenerator random()
Since 0.1.0-alpha.4 or earlier
Randomness for this placement; the same world seed and position give the same values.
Returns RandomGenerator
blockAt(BlockPos)
ResourceId blockAt(BlockPos pos)
Since 0.1.0-alpha.4 or earlier
The block at pos, without properties.
| Parameter | Type | Description |
|---|---|---|
pos | BlockPos | — |
Returns ResourceId
isAir(BlockPos)
boolean isAir(BlockPos pos)
Since 0.1.0-alpha.4 or earlier
Whether pos is air.
| Parameter | Type | Description |
|---|---|---|
pos | BlockPos | — |
Returns boolean
setBlock(BlockPos, ResourceId)
void setBlock(BlockPos pos, ResourceId block)
Since 0.1.0-alpha.4 or earlier
Sets the default state of block at pos.
| Parameter | Type | Description |
|---|---|---|
pos | BlockPos | — |
block | ResourceId | — |
Throws IllegalArgumentException — if block is not a block
surfaceY(int, int)
int surfaceY(int x, int z)
Since 0.1.0-alpha.4 or earlier
The y of the first air block above the terrain at x, z, as generation sees it so far.
| Parameter | Type | Description |
|---|---|---|
x | int | — |
z | int | — |
Returns int
minY()
int minY()
Since 0.1.0-alpha.4 or earlier
The lowest block y of the world.
Returns int
maxY()
int maxY()
Since 0.1.0-alpha.4 or earlier
The highest block y of the world.
Returns int
FeaturePlacement
record · Stability PREVIEW · Since 0.1.0-alpha.4 or earlier
public record FeaturePlacement(int countPerChunk, int rarity, boolean onSurface, int minY, int maxY)
Where a CodeFeature is tried in each chunk: how often, and at which height. Poly Mod Loader writes it as the placed feature with the feature's ID, the same as one from a data pack.
| Component | Type | Description |
|---|---|---|
countPerChunk | int | tries per chunk, each at a random x and z in the chunk |
rarity | int | each try happens in 1 of rarity chunks; 1 for every chunk |
onSurface | boolean | whether tries start on the terrain surface; otherwise at a random y in minY..maxY |
minY | int | lowest y for tries below the surface |
maxY | int | highest y for tries below the surface |
onSurface(int)
public static FeaturePlacement onSurface(int countPerChunk)
Since 0.1.0-alpha.4 or earlier
countPerChunk tries on the surface of each chunk.
| Parameter | Type | Description |
|---|---|---|
countPerChunk | int | — |
Returns FeaturePlacement
atHeight(int, int, int)
public static FeaturePlacement atHeight(int countPerChunk, int minY, int maxY)
Since 0.1.0-alpha.4 or earlier
countPerChunk tries at random heights from minY to maxY in each chunk.
| Parameter | Type | Description |
|---|---|---|
countPerChunk | int | — |
minY | int | — |
maxY | int | — |
Returns FeaturePlacement
rarity(int)
public FeaturePlacement rarity(int rarity)
Since 0.1.0-alpha.4 or earlier
This placement in only 1 of rarity chunks.
| Parameter | Type | Description |
|---|---|---|
rarity | int | — |
Returns FeaturePlacement
GenerationStepName
enum · Stability PREVIEW · Since 0.1.0-alpha.4 or earlier
public enum GenerationStepName
The feature placement steps of world generation, in the order the game runs them.
| Constant | Description |
|---|---|
RAW_GENERATION | — |
LAKES | — |
LOCAL_MODIFICATIONS | — |
UNDERGROUND_STRUCTURES | — |
SURFACE_STRUCTURES | — |
STRONGHOLDS | — |
UNDERGROUND_ORES | — |
UNDERGROUND_DECORATION | — |
FLUID_SPRINGS | — |
VEGETAL_DECORATION | — |
TOP_LAYER_MODIFICATION | — |
NoiseFunction
functional interface · Stability PREVIEW · Since 0.1.0-alpha.4 or earlier
public interface NoiseFunction
A density value per block position, used inside the game's noise terrain as a density function (WorldgenRegistrar.densityFunction). In the game's terrain, positive final density is solid and negative is air or water, so a function can raise, carve or reshape terrain while the game keeps its caves, aquifers, ores, surface rules and biomes.
The game computes noise terrain in cells (noise.size_horizontal × 4 by noise.size_vertical × 4 blocks) and blends the final density inside a cell, so shapes smaller than a cell come out smoothed and a surface may be a block off the exact value.
Called extremely often from several world generation threads at once: it must be fast, keep no state, and give the same value for the same position every time.
compute(int, int, int)
double compute(int x, int y, int z)
Since 0.1.0-alpha.4 or earlier
The density at block x, y, z.
| Parameter | Type | Description |
|---|---|---|
x | int | — |
y | int | — |
z | int | — |
Returns double
StructureBuilder
functional interface · Stability PREVIEW · Since 0.1.0-alpha.4 or earlier
public interface StructureBuilder
Builds a code structure's blocks into its box. Called on world generation threads, once per chunk the box touches (see StructurePieceContext); keep all state in local variables.
build(StructurePieceContext)
void build(StructurePieceContext context)
Since 0.1.0-alpha.4 or earlier
Writes the structure's blocks through context.
| Parameter | Type | Description |
|---|---|---|
context | StructurePieceContext | — |
StructureDefinition
record · Stability PREVIEW · Since 0.1.0-alpha.4 or earlier
public record StructureDefinition(int sizeX, int sizeY, int sizeZ, int yOffset, BiomeSelector biomes, int spacing, int separation, GenerationStepName step, boolean adaptTerrain, StructureBuilder builder)
A structure built in code: a box placed on the terrain surface at the centre of chosen chunks, filled by a StructureBuilder. Poly Mod Loader writes the structure and its structure set into the generated data pack, so /locate structure and /place structure work with its ID.
| Component | Type | Description |
|---|---|---|
sizeX | int | box size along x, 1–128 |
sizeY | int | box size along y, 1–256 |
sizeZ | int | box size along z, 1–128 |
yOffset | int | where the box's bottom is relative to the surface; negative sinks it into the ground |
biomes | BiomeSelector | where it may generate |
spacing | int | average distance between structures, in chunks (village 34) |
separation | int | minimum distance between structures, in chunks; less than spacing |
step | GenerationStepName | the generation step it is built in |
adaptTerrain | boolean | whether the terrain is smoothed around it, like around a village |
builder | StructureBuilder | builds its blocks |
builder(int, int, int, StructureBuilder)
public static StructureDefinition.Builder builder(int sizeX, int sizeY, int sizeZ, StructureBuilder builder)
Since 0.1.0-alpha.4 or earlier
A builder for a sizeX × sizeY × sizeZ structure built by builder.
| Parameter | Type | Description |
|---|---|---|
sizeX | int | — |
sizeY | int | — |
sizeZ | int | — |
builder | StructureBuilder | — |
Returns StructureDefinition.Builder
StructureDefinition.Builder
class · Since 0.1.0-alpha.4 or earlier
public static final class Builder
Builds a StructureDefinition.
yOffset(int)
public StructureDefinition.Builder yOffset(int yOffset)
Since 0.1.0-alpha.4 or earlier
Raises (or with a negative value sinks) the box relative to the surface; 0 by default.
| Parameter | Type | Description |
|---|---|---|
yOffset | int | — |
Returns StructureDefinition.Builder
biomes(BiomeSelector)
public StructureDefinition.Builder biomes(BiomeSelector biomes)
Since 0.1.0-alpha.4 or earlier
Where it may generate; every overworld biome (#minecraft:is_overworld) by default.
| Parameter | Type | Description |
|---|---|---|
biomes | BiomeSelector | — |
Returns StructureDefinition.Builder
spacing(int, int)
public StructureDefinition.Builder spacing(int spacing, int separation)
Since 0.1.0-alpha.4 or earlier
Average and minimum distance between structures in chunks; 32 and 8 by default.
| Parameter | Type | Description |
|---|---|---|
spacing | int | — |
separation | int | — |
Returns StructureDefinition.Builder
step(GenerationStepName)
public StructureDefinition.Builder step(GenerationStepName step)
Since 0.1.0-alpha.4 or earlier
The generation step; GenerationStepName.SURFACE_STRUCTURES by default.
| Parameter | Type | Description |
|---|---|---|
step | GenerationStepName | — |
Returns StructureDefinition.Builder
adaptTerrain()
public StructureDefinition.Builder adaptTerrain()
Since 0.1.0-alpha.4 or earlier
Smooths the terrain around the box, like around a village.
Returns StructureDefinition.Builder
build()
public StructureDefinition build()
Since 0.1.0-alpha.4 or earlier
Creates the definition; invalid values throw IllegalArgumentException.
Returns StructureDefinition
StructurePieceContext
interface · Stability PREVIEW · Since 0.1.0-alpha.4 or earlier
public interface StructurePieceContext
The box a StructureBuilder builds in, valid only during StructureBuilder.build. Coordinates are relative to the box's lowest corner, from 0 to size - 1 on each axis; blocks outside the box are ignored.
A structure larger than one chunk is built chunk by chunk: the builder is called once for each chunk the box touches, with the same random() sequence each time, and only the blocks in that chunk are written. Build the same structure on every call.
origin()
BlockPos origin()
Since 0.1.0-alpha.4 or earlier
World position of the box's lowest corner.
Returns BlockPos
sizeX()
int sizeX()
Since 0.1.0-alpha.4 or earlier
Box size along x.
Returns int
sizeY()
int sizeY()
Since 0.1.0-alpha.4 or earlier
Box size along y.
Returns int
sizeZ()
int sizeZ()
Since 0.1.0-alpha.4 or earlier
Box size along z.
Returns int
random()
RandomGenerator random()
Since 0.1.0-alpha.4 or earlier
Randomness for this structure; the same on every call for the same structure.
Returns RandomGenerator
blockAt(int, int, int)
ResourceId blockAt(int x, int y, int z)
Since 0.1.0-alpha.4 or earlier
The block at a box position, without properties.
| Parameter | Type | Description |
|---|---|---|
x | int | — |
y | int | — |
z | int | — |
Returns ResourceId
setBlock(int, int, int, ResourceId)
void setBlock(int x, int y, int z, ResourceId block)
Since 0.1.0-alpha.4 or earlier
Sets the default state of block at a box position.
| Parameter | Type | Description |
|---|---|---|
x | int | — |
y | int | — |
z | int | — |
block | ResourceId | — |
Throws IllegalArgumentException — if block is not a block
fill(int, int, int, int, int, int, ResourceId)
default void fill(int x1, int y1, int z1, int x2, int y2, int z2, ResourceId block)
Since 0.1.0-alpha.4 or earlier
Fills the box positions from (x1, y1, z1) to (x2, y2, z2), both included.
| Parameter | Type | Description |
|---|---|---|
x1 | int | — |
y1 | int | — |
z1 | int | — |
x2 | int | — |
y2 | int | — |
z2 | int | — |
block | ResourceId | — |
TerrainGenerator
functional interface · Stability PREVIEW · Since 0.1.0-alpha.4 or earlier
public interface TerrainGenerator
Terrain written in code: fills each block column of new chunks. Registered with WorldgenRegistrar.chunkGenerator, it is used by dimensions in data packs with "generator": {"type": "<mod id>:<path>", "biome_source": {...}}. Biome features (ores, trees) and structures are added afterwards by the game as for any generator.
Threads: called on the game's world generation threads, several columns at once; the code must be thread-safe and give the same column for the same position and seed.
fillColumn(int, int, ColumnBuilder)
void fillColumn(int x, int z, ColumnBuilder column)
Since 0.1.0-alpha.4 or earlier
Fills the column at world position x, z; unset blocks stay air.
| Parameter | Type | Description |
|---|---|---|
x | int | — |
z | int | — |
column | ColumnBuilder | — |
seaLevel()
default int seaLevel()
Since 0.1.0-alpha.4 or earlier
Sea level of dimensions using this generator; the game spawns water mobs and fish below it.
Returns int
WorldgenRegistrar
interface · Stability PREVIEW · Since 0.1.0-alpha.4 or earlier
public interface WorldgenRegistrar
Changes world generation. The features themselves are data: put data/<mod id>/worldgen/configured_feature/*.json and placed_feature/*.json in the mod jar, in the game's format. Custom dimensions are data too (dimension/, dimension_type/). This registrar attaches placed features to existing biomes, which data alone cannot do without replacing the biome files.
When: common entrypoints. Applied every time a server loads its worlds; affects chunks generated afterwards.
addFeature(BiomeSelector, GenerationStepName, ResourceId)
void addFeature(BiomeSelector biomes, GenerationStepName step, ResourceId placedFeature)
Since 0.1.0-alpha.4 or earlier
Adds a placed feature at the end of step in every selected biome.
| Parameter | Type | Description |
|---|---|---|
biomes | BiomeSelector | — |
step | GenerationStepName | — |
placedFeature | ResourceId | ID of a placed feature from any data pack, for example the mod's own |
chunkGenerator(String, TerrainGenerator)
ResourceId chunkGenerator(String path, TerrainGenerator generator)
Since 0.1.0-alpha.4 or earlier
Registers terrain written in code as generator type <mod id>:<path>, for dimensions in data packs.
| Parameter | Type | Description |
|---|---|---|
path | String | — |
generator | TerrainGenerator | — |
Returns ResourceId — the generator type ID
Throws IllegalArgumentException — for an invalid or used path (POLY-WORLDGEN-001)
biome(String, BiomeDefinition)
ResourceId biome(String path, BiomeDefinition definition)
Since 0.1.0-alpha.4 or earlier
Defines biome <mod id>:<path> in code. Use it in dimensions and biome tags like a biome from a data pack.
| Parameter | Type | Description |
|---|---|---|
path | String | — |
definition | BiomeDefinition | — |
Returns ResourceId — the biome ID
feature(String, FeaturePlacement, CodeFeature)
ResourceId feature(String path, FeaturePlacement placement, CodeFeature feature)
Since 0.1.0-alpha.4 or earlier
Registers a feature written in code as feature type <mod id>:<path>, and writes a configured and a placed feature with the same ID into Poly Mod Loader's generated data pack. Add it to biomes with addFeature, place it with /place feature <id>, or use the type in the mod's own data pack.
| Parameter | Type | Description |
|---|---|---|
path | String | — |
placement | FeaturePlacement | — |
feature | CodeFeature | — |
Returns ResourceId — the feature ID
Throws IllegalArgumentException — for an invalid or used path (POLY-WORLDGEN-004)
densityFunction(String, double, double, NoiseFunction)
ResourceId densityFunction(String path, double minValue, double maxValue, NoiseFunction function)
Since 0.1.0-alpha.4 or earlier
Registers a density function written in code as type <mod id>:<path>. Data packs use it inside the game's noise terrain, for example in a noise settings' final_density: {"type": "minecraft:add", "argument1": …, "argument2": {"type": "<mod id>:<path>"}}.
| Parameter | Type | Description |
|---|---|---|
path | String | — |
minValue | double | the lowest value function returns; the game uses the bounds to skip work |
maxValue | double | the highest value function returns |
function | NoiseFunction | — |
Returns ResourceId — the density function type ID
Throws IllegalArgumentException — for an invalid or used path (POLY-WORLDGEN-004) or minValue > maxValue
structure(String, StructureDefinition)
ResourceId structure(String path, StructureDefinition definition)
Since 0.1.0-alpha.4 or earlier
Registers a structure built in code as <mod id>:<path>, with its structure set, in Poly Mod Loader's generated data pack. It generates in new chunks of the selected biomes; /locate structure and /place structure find and place it.
| Parameter | Type | Description |
|---|---|---|
path | String | — |
definition | StructureDefinition | — |
Returns ResourceId — the structure ID
Throws IllegalArgumentException — for an invalid or used path (POLY-WORLDGEN-004)