Skip to content

API reference / @jsprismarine/worldgen / WorldgenData

Class: WorldgenData ​

Defined in: WorldgenData.ts:25

The parsed worldgen registries for one data pack stack.

Parsing is lazy and memoized per identifier, so a reference reached from twenty places yields the same tree object. The compiler keys its cache slots off that identity, which is how a shared subtree such as minecraft:shift_x is evaluated once per position.

Constructors ​

Constructor ​

new WorldgenData(source): WorldgenData

Defined in: WorldgenData.ts:31

Parameters ​

source ​

WorldgenDataSource

Returns ​

WorldgenData

Accessors ​

densityFunctionIds ​

Get Signature ​

get densityFunctionIds(): string[]

Defined in: WorldgenData.ts:34

The identifiers of every density function in the stack.

Returns ​

string[]


noiseIds ​

Get Signature ​

get noiseIds(): string[]

Defined in: WorldgenData.ts:39

The identifiers of every noise in the stack.

Returns ​

string[]


noiseSettingsIds ​

Get Signature ​

get noiseSettingsIds(): string[]

Defined in: WorldgenData.ts:44

The identifiers of every noise settings document in the stack.

Returns ​

string[]

Methods ​

densityFunction() ​

densityFunction(reference): DensityFunctionNode

Defined in: WorldgenData.ts:54

Parses a density function, following its references.

Parameters ​

reference ​

string

Returns ​

DensityFunctionNode

Throws ​

When the identifier is missing from the stack, or when the references form a cycle, which Java's lazy holders would turn into a stack overflow at sample time.


noise() ​

noise(reference): NormalNoise

Defined in: WorldgenData.ts:82

Parses a noise parameter document.

Parameters ​

reference ​

string

Returns ​

NormalNoise

Throws ​

When the identifier is missing from the stack.


settings() ​

settings(reference): NoiseGeneratorSettings

Defined in: WorldgenData.ts:98

Parses a noise settings document and every density function it reaches.

Parameters ​

reference ​

string

Returns ​

NoiseGeneratorSettings

Throws ​

When the identifier is missing from the stack.