Skip to content

API reference / @jsprismarine/prismarine / world/generators/datadriven/javaTemplatePlacement

world/generators/datadriven/javaTemplatePlacement ​

Interfaces ​

TemplateSource ​

Defined in: packages/prismarine/src/world/generators/datadriven/javaTemplatePlacement.ts:42

Where the templates and their processor lists are read from.

Properties ​

worldgenFingerprint? ​

readonly optional worldgenFingerprint?: () => string

Defined in: packages/prismarine/src/world/generators/datadriven/javaTemplatePlacement.ts:49

Stable content fingerprint for persistent world generation caches.

Custom sources may omit it when disk caching is unused. An opted-in persistent cache requires a fingerprint so a changed template source cannot reuse an old terrain tile.

Returns ​

string

Methods ​

processorList() ​

processorList(identifier): unknown

Defined in: packages/prismarine/src/world/generators/datadriven/javaTemplatePlacement.ts:58

The worldgen/processor_list document for an identifier, parsed no further than JSON.

Parameters ​
identifier ​

string

Returns ​

unknown

template() ​

template(identifier): JavaStructureTemplate | undefined

Defined in: packages/prismarine/src/world/generators/datadriven/javaTemplatePlacement.ts:56

The template for an identifier such as minecraft:fossil/spine_1.

Parameters ​
identifier ​

string

Returns ​

JavaStructureTemplate | undefined

The template, or undefined when this server does not carry it, which makes the feature place nothing rather than place something wrong.


TemplateTarget ​

Defined in: packages/prismarine/src/world/generators/datadriven/javaTemplatePlacement.ts:62

What placing a template needs from the region it lands in.

Methods ​

blockAt() ​

blockAt(x, y, z): BlockState

Defined in: packages/prismarine/src/world/generators/datadriven/javaTemplatePlacement.ts:64

The Java state already in the region at a world position.

Parameters ​
x ​

number

y ​

number

z ​

number

Returns ​

BlockState

hasTag() ​

hasTag(identifier, tag): boolean

Defined in: packages/prismarine/src/world/generators/datadriven/javaTemplatePlacement.ts:68

Whether a block identifier is in a Java block tag.

Parameters ​
identifier ​

string

tag ​

string

Returns ​

boolean

heightAt() ​

heightAt(heightmap, x, z): number

Defined in: packages/prismarine/src/world/generators/datadriven/javaTemplatePlacement.ts:66

The surface height of a world column, for a request that projects to a heightmap.

Parameters ​
heightmap ​

HeightmapType

x ​

number

z ​

number

Returns ​

number

setBlockEntity()? ​

optional setBlockEntity(x, y, z, request): void

Defined in: packages/prismarine/src/world/generators/datadriven/javaTemplatePlacement.ts:77

Records the block entity a template block carries, on a block that landed.

Optional, because a target that cannot store one still gets the block. What it costs is the block's contents: a desert well's suspicious sand with nothing to brush out of it.

Parameters ​
x ​

number

y ​

number

z ​

number

request ​

BlockEntityRequest

Returns ​

void

write() ​

write(x, y, z, state): boolean

Defined in: packages/prismarine/src/world/generators/datadriven/javaTemplatePlacement.ts:70

Writes one resolved block. Returns whether it landed inside the region.

Parameters ​
x ​

number

y ​

number

z ​

number

state ​

BedrockBlockState

Returns ​

boolean

Functions ​

bedrockStateOf() ​

bedrockStateOf(state): BedrockBlockState | undefined

Defined in: packages/prismarine/src/world/generators/datadriven/javaTemplatePlacement.ts:89

The Bedrock state a Java one maps to, or undefined when the mapping has no row for it.

Parameters ​

state ​

BlockState

Returns ​

BedrockBlockState | undefined


placeJavaTemplate() ​

placeJavaTemplate(request, source, target, seed): boolean

Defined in: packages/prismarine/src/world/generators/datadriven/javaTemplatePlacement.ts:102

Places one template.

Parameters ​

request ​

TemplateRequest

source ​

TemplateSource

target ​

TemplateTarget

seed ​

bigint

The world seed, which together with the origin seeds the processors' draws. Java passes the feature's own random, which does not reach this far; deriving the stream from the position instead keeps a fossil's rot the same every time the chunk is generated.

Returns ​

boolean

Whether any block landed, which is what the feature reports upward.