[API reference](https://jsprismarine.dev/api/index.md) / [@jsprismarine/prismarine](https://jsprismarine.dev/api/@jsprismarine/prismarine/index.md) / world/Generator

# world/Generator

## Classes

- [GenerationStopped](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/Generator/classes/GenerationStopped.md)

## Interfaces

### BiomeSearchRequest

Defined in: [packages/prismarine/src/world/Generator.ts:90](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L90)

What a biome search asks a generator; see [Generator.locateBiome](#locatebiome).

#### Properties

##### horizontalStep

> `readonly` **horizontalStep**: `number`

Defined in: [packages/prismarine/src/world/Generator.ts:98](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L98)

Blocks between two columns of the sampling grid; Java's 32.

##### radius

> `readonly` **radius**: `number`

Defined in: [packages/prismarine/src/world/Generator.ts:96](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L96)

How far out to look, in blocks, as a square around the origin. Java's `/locate biome` uses 6400.

##### seed?

> `readonly` `optional` **seed?**: `bigint`

Defined in: [packages/prismarine/src/world/Generator.ts:103](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L103)

##### verticalStep

> `readonly` **verticalStep**: `number`

Defined in: [packages/prismarine/src/world/Generator.ts:100](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L100)

Blocks between two samples of a column; Java's 64.

##### wanted

> `readonly` **wanted**: (`biome`) => `boolean`

Defined in: [packages/prismarine/src/world/Generator.ts:102](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L102)

Whether a biome identifier is one the caller wants, so a tag costs the same as one biome.

###### Parameters

###### biome

`string`

###### Returns

`boolean`

##### x

> `readonly` **x**: `number`

Defined in: [packages/prismarine/src/world/Generator.ts:92](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L92)

Where to search from, in blocks.

##### y

> `readonly` **y**: `number`

Defined in: [packages/prismarine/src/world/Generator.ts:93](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L93)

##### z

> `readonly` **z**: `number`

Defined in: [packages/prismarine/src/world/Generator.ts:94](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L94)

***

### BiomeSearchResult

Defined in: [packages/prismarine/src/world/Generator.ts:107](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L107)

Where a biome search found a cell; see [Generator.locateBiome](#locatebiome).

#### Properties

##### biome

> `readonly` **biome**: `string`

Defined in: [packages/prismarine/src/world/Generator.ts:109](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L109)

The biome identifier, for example `minecraft:plains`.

##### x

> `readonly` **x**: `number`

Defined in: [packages/prismarine/src/world/Generator.ts:111](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L111)

The sampled position, in blocks.

##### y

> `readonly` **y**: `number`

Defined in: [packages/prismarine/src/world/Generator.ts:112](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L112)

##### z

> `readonly` **z**: `number`

Defined in: [packages/prismarine/src/world/Generator.ts:113](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L113)

***

### ChunkRequestOptions

Defined in: [packages/prismarine/src/world/Generator.ts:148](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L148)

How a chunk request is scheduled against every other outstanding one.

#### Properties

##### urgency?

> `readonly` `optional` **urgency?**: `"immediate"` \| `"soon"` \| `"idle"`

Defined in: [packages/prismarine/src/world/Generator.ts:155](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L155)

How badly the chunk is wanted, which decides its turn when the generator is busy.

Defaults to `immediate`, so a caller that has not thought about it waits the way it
always did. See [GenerationPriority](https://jsprismarine.dev/api/@jsprismarine/chunkgen/index.md#generationpriority).

***

### GenerationControl

Defined in: [packages/prismarine/src/world/Generator.ts:120](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L120)

What a benchmark and the generation governor may do to a generator's worker pools.

#### Methods

##### cancelQueued()

> **cancelQueued**(`matching?`): `number`

Defined in: [packages/prismarine/src/world/Generator.ts:131](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L131)

Drops the tasks still waiting for a worker that a rule picks out, or all of them without one,
and reports how many went. Dropping a task a player's chunk depends on leaves that chunk
waiting, so a benchmark names its own region.

###### Parameters

###### matching?

(`task`) => `boolean`

###### Returns

`number`

##### outstanding()

> **outstanding**(): `number`

Defined in: [packages/prismarine/src/world/Generator.ts:133](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L133)

How many tasks are with a worker or waiting for one, across every pool.

###### Returns

`number`

##### resetStats()

> **resetStats**(): `void`

Defined in: [packages/prismarine/src/world/Generator.ts:137](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L137)

Forgets the recorded task stats.

###### Returns

`void`

##### setBackgroundLimit()

> **setBackgroundLimit**(`limit`): `void`

Defined in: [packages/prismarine/src/world/Generator.ts:125](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L125)

Limits how many `soon` and `idle` tasks may be with workers at once. `immediate` tasks are
never limited. Undefined removes the limit.

###### Parameters

###### limit

`number` \| `undefined`

###### Returns

`void`

##### stats()

> **stats**(): [`GenerationStatsSnapshot`](https://jsprismarine.dev/api/@jsprismarine/chunkgen/index.md#generationstatssnapshot)

Defined in: [packages/prismarine/src/world/Generator.ts:135](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L135)

Every pool's recorded task stats, merged.

###### Returns

[`GenerationStatsSnapshot`](https://jsprismarine.dev/api/@jsprismarine/chunkgen/index.md#generationstatssnapshot)

***

### Generator

Defined in: [packages/prismarine/src/world/Generator.ts:158](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L158)

#### Properties

##### generatesInline?

> `readonly` `optional` **generatesInline?**: `boolean`

Defined in: [packages/prismarine/src/world/Generator.ts:211](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L211)

True when the generator builds every chunk on the calling thread from a fixed, small amount
of work, such as stacking a flat world's layers, with no worker pool behind it.

The chunk scheduler holds deliveries that need generation to twice the worker count, so a
pool is never handed more requests than it can start. A chunk that needs no worker does not
wait for that depth; the scheduler bounds those by the count one input step admits instead.
Optional, and false when absent, which is right for any generator that samples noise.

##### seaLevel?

> `readonly` `optional` **seaLevel?**: `number`

Defined in: [packages/prismarine/src/world/Generator.ts:222](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L222)

The y this generator floods to, Java's `ChunkGenerator.getSeaLevel`.

A noise generator answers its settings' `sea_level`; the flat generator answers Java's
-63. Optional, because a generator with no water line of its own has nothing to say and
the world then assumes the Overworld's 63, which is what Java's debug generator answers.

###### Java See

ChunkGenerator.getSeaLevel

#### Methods

##### biomeAt()?

> `optional` **biomeAt**(`x`, `y`, `z`, `seed?`): `string` \| `undefined`

Defined in: [packages/prismarine/src/world/Generator.ts:289](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L289)

The biome at a block as Java's `ServerLevel.getBiome` answers it, read from the noise rather
than a chunk: the dimension's biome cells with `BiomeManager`'s jitter.

###### Parameters

###### x

`number`

###### y

`number`

###### z

`number`

###### seed?

`bigint`

###### Returns

`string` \| `undefined`

###### Java See

LevelReader.getBiome

##### generateChunk()

> **generateChunk**(`cx`, `cz`, `seed?`, `config?`, `options?`): `Promise`\<[`Chunk`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/chunk/Chunk/classes/Chunk.md)\>

Defined in: [packages/prismarine/src/world/Generator.ts:165](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L165)

This function should return the generated chunk by given parameters.

###### Parameters

###### cx

`number`

###### cz

`number`

###### seed?

`bigint`

###### config?

`Partial`\<[`WorldData`](https://jsprismarine.dev/api/@jsprismarine/prismarine/config/JsonConfigTypes/index.md#worlddata)\>

###### options?

[`ChunkRequestOptions`](#chunkrequestoptions)

How the request is scheduled. A generator that answers one at a time
may ignore it; a pooled one orders its backlog by it.

###### Returns

`Promise`\<[`Chunk`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/chunk/Chunk/classes/Chunk.md)\>

##### generationControl()?

> `optional` **generationControl**(): [`GenerationControl`](#generationcontrol) \| `undefined`

Defined in: [packages/prismarine/src/world/Generator.ts:250](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L250)

A handle on the generator's worker pools, for measurement.

Optional, because a generator with no pool has nothing to hold back or count. The handle
does not change what is generated: pausing only delays when a queued task reaches a worker.

###### Returns

[`GenerationControl`](#generationcontrol) \| `undefined`

The handle, or undefined when no pool is running.

##### locatableNames()?

> `optional` **locatableNames**(`kind`): readonly `string`[]

Defined in: [packages/prismarine/src/world/Generator.ts:327](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L327)

Every identifier and `#tag` a `/locate` of one kind may name, for its suggestions.

Registry-wide rather than per dimension, as Java's suggestions are: a Nether player is
offered `minecraft:village_plains` and told it is not nearby.

Optional, because a generator without Java's registries has nothing to suggest beyond
Mojang's published list.

###### Parameters

###### kind

`"biome"` \| `"structure"`

###### Returns

readonly `string`[]

##### locate()?

> `optional` **locate**(`request`): [`StructureSearchResult`](#structuresearchresult) \| `undefined`

Defined in: [packages/prismarine/src/world/Generator.ts:268](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L268)

The nearest structure a search accepts, without generating anything.

This is what `/locate` asks. A structure's position is a function of the seed and the
placement grid alone, so the answer comes from laying candidates out against the bare
noise terrain: no chunk is built, nothing is written, and a search over thousands of
blocks costs a few hundred layout attempts rather than thousands of chunks.

Synchronous, like [Generator.surfaceAt](#surfaceat) and for the same reason: the command layer
that asks is synchronous, and the work is arithmetic rather than a chunk.

Optional, because a generator that places no structures has nothing to find.

###### Parameters

###### request

[`StructureSearchRequest`](#structuresearchrequest)

Where to search from, how far, and which structures count.

###### Returns

[`StructureSearchResult`](#structuresearchresult) \| `undefined`

The nearest match, or undefined when the radius held none.

##### locateBiome()?

> `optional` **locateBiome**(`request`): [`BiomeSearchResult`](#biomesearchresult) \| `undefined`

Defined in: [packages/prismarine/src/world/Generator.ts:305](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L305)

The nearest cell of a biome a search accepts, without generating anything.

This is what `/locate biome` asks: Java's `BiomeSource.findClosestBiome3d`, a grid laid
over the climate sampler and walked outward from the origin. Synchronous for the same
reason [Generator.locate](#locate) is.

Optional, because a generator with no biome source of its own has nothing to walk.

###### Parameters

###### request

[`BiomeSearchRequest`](#biomesearchrequest)

###### Returns

[`BiomeSearchResult`](#biomesearchresult) \| `undefined`

The first grid cell met that holds a wanted biome, or undefined when the radius
held none or no wanted biome can occur in this dimension.

###### Java See

BiomeSource.findClosestBiome3d

##### membersOfTag()?

> `optional` **membersOfTag**(`registry`, `tag`): `ReadonlySet`\<`string`\> \| `undefined`

Defined in: [packages/prismarine/src/world/Generator.ts:316](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L316)

The identifiers a `#tag` of one registry names, which is how `/locate structure
#minecraft:village` and an eye of ender's `#minecraft:eye_of_ender_located` are read.

Optional, because only a generator built from Java's data carries its tags.

###### Parameters

###### registry

[`LocateTagRegistry`](#locatetagregistry)

###### tag

`string`

The tag's identifier without the `#`, for example `minecraft:village`.

###### Returns

`ReadonlySet`\<`string`\> \| `undefined`

The members, or undefined when the generator knows no tag by that name.

##### raiseUrgency()?

> `optional` **raiseUrgency**(`cx`, `cz`, `urgency`): `void`

Defined in: [packages/prismarine/src/world/Generator.ts:240](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L240)

Says that a chunk already asked for is wanted more than it was.

A chunk is requested once and waited on by everybody who wants it, so the band it was
given is whoever asked first. A rim chunk queued as `idle` is the chunk a player is
standing on a moment later, and nothing else would move it up.

Only affects a request still waiting for a worker. One already being built finishes at
the speed it was going to finish at either way.

Optional, because a generator with no queue has no turn to move.

###### Parameters

###### cx

`number`

Chunk x of the request.

###### cz

`number`

Chunk z of the request.

###### urgency

`"immediate"` \| `"soon"` \| `"idle"`

The band to move it into. Never lowers one.

###### Returns

`void`

##### spawnChunk()?

> `optional` **spawnChunk**(`seed?`): [`SpawnChunkResult`](#spawnchunkresult)

Defined in: [packages/prismarine/src/world/Generator.ts:200](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L200)

Selects the spawn chunk from the generator's climate targets without sampling terrain columns.
The world resolves a safe block position from that chunk after it is generated.

###### Parameters

###### seed?

`bigint`

###### Returns

[`SpawnChunkResult`](#spawnchunkresult)

##### stopGenerating()?

> `optional` **stopGenerating**(): `void`

Defined in: [packages/prismarine/src/world/Generator.ts:354](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L354)

Gives up every chunk request that has not started yet, for a server that is shutting down.

A generator that answers one request at a time holds a queue, and a start region fills
that queue thirty-two chunks at a time. Waiting for it to drain means a shutdown spends
seconds generating terrain that the save it is about to run will not even look at. The
request that is already running finishes, so no half-generated chunk is handed back;
everything behind it rejects with [GenerationStopped](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/Generator/classes/GenerationStopped.md).

Optional, because a generator that answers immediately has no queue to give up.

###### Returns

`void`

##### structureSpawnOverrideAt()?

> `optional` **structureSpawnOverrideAt**(`identifier`, `at`, `seed?`): `boolean` \| `undefined`

Defined in: [packages/prismarine/src/world/Generator.ts:341](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L341)

Whether Java structure spawn overrides reserve an entity type at one position.

Generators without Java structure data omit the query. A generator with Java data returns
`undefined` for an entity that also appears in Java's biome spawn tables or has no
structure override. Structure-only entities return `false` outside matching overrides and
`true` inside one.

###### Parameters

###### identifier

`string`

The Bedrock entity identifier used by the live spawner.

###### at

[`GeneratorPosition`](#generatorposition)

The entity's candidate spawn position in blocks.

###### seed?

`bigint`

The world seed used to lay out structures.

###### Returns

`boolean` \| `undefined`

##### structureStartsContaining()?

> `optional` **structureStartsContaining**(`at`, `seed?`): readonly `object`[]

Defined in: [packages/prismarine/src/world/Generator.ts:278](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L278)

The structure starts with a piece that holds a block, by structure and start chunk, which
is Java's `StructureManager.getStructureAt`. Like [Generator.locate](#locate) it reads the
layout rather than a chunk.

###### Parameters

###### at

The block.

###### x

`number`

###### y

`number`

###### z

`number`

###### seed?

`bigint`

###### Returns

readonly `object`[]

###### Java Source

StructureManager.getStructureAt(Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/levelgen/structure/Structure;)Lnet/minecraft/world/level/levelgen/structure/StructureStart;

##### surfaceAt()?

> `optional` **surfaceAt**(`x`, `z`, `seed?`): [`SurfaceProbe`](#surfaceprobe)

Defined in: [packages/prismarine/src/world/Generator.ts:194](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L194)

The topmost block of one column, without generating the chunk it is in.

The answer comes from the bare terrain: no surface rule has run and nothing has decorated,
so a flooded column reads as water and a wooded one reads as the ground under the trees
rather than as a canopy. That is Java's `ChunkGenerator.getBaseHeight`, and it is what a
spawn search wants - whether a player can stand here is a question about the land, and
answering it by generating a finished chunk costs four orders of magnitude more.

Optional, because a generator with no cheaper answer than its own chunks has nothing to
add here and a caller falls back to generating one.

###### Parameters

###### x

`number`

###### z

`number`

###### seed?

`bigint`

###### Returns

[`SurfaceProbe`](#surfaceprobe)

###### Java See

ChunkGenerator.getBaseHeight

##### useStoredChunks()?

> `optional` **useStoredChunks**(`stored`): `void`

Defined in: [packages/prismarine/src/world/Generator.ts:178](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L178)

Tells the generator which chunks its dimension's save already holds, so new terrain can
blend toward the old ones the way Java's `Blender` does. The provider calls it before it
asks for a chunk; a generator that does not blend ignores it.

###### Parameters

###### stored

[`StoredChunkReader`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/providers/Provider/index.md#storedchunkreader)

###### Returns

`void`

***

### GeneratorPosition

Defined in: [packages/prismarine/src/world/Generator.ts:141](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L141)

A block position in a generator's world.

#### Properties

##### x

> `readonly` **x**: `number`

Defined in: [packages/prismarine/src/world/Generator.ts:142](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L142)

##### y

> `readonly` **y**: `number`

Defined in: [packages/prismarine/src/world/Generator.ts:143](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L143)

##### z

> `readonly` **z**: `number`

Defined in: [packages/prismarine/src/world/Generator.ts:144](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L144)

***

### SpawnChunkResult

Defined in: [packages/prismarine/src/world/Generator.ts:35](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L35)

The chunk selected by a noise generator's climate-based spawn search.

#### Properties

##### candidates

> `readonly` **candidates**: `number`

Defined in: [packages/prismarine/src/world/Generator.ts:39](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L39)

Number of climate candidates evaluated, for profiling the search without timing assertions.

##### chunkX

> `readonly` **chunkX**: `number`

Defined in: [packages/prismarine/src/world/Generator.ts:36](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L36)

##### chunkZ

> `readonly` **chunkZ**: `number`

Defined in: [packages/prismarine/src/world/Generator.ts:37](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L37)

***

### StructureSearchRequest

Defined in: [packages/prismarine/src/world/Generator.ts:48](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L48)

What a structure search was asked for.

The origin is in blocks because that is what a player's position is; the radius is in chunks
because that is the unit a structure set is spaced in.

#### Properties

##### radius

> `readonly` **radius**: `number`

Defined in: [packages/prismarine/src/world/Generator.ts:58](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L58)

How far out to look, in rings of placement regions, which is how Java's `/locate` and eye
of ender count their radius of 100. A village set spaced 34 chunks apart is reached 3400
chunks out; a concentric ring placement such as the strongholds' is searched whole.

##### seed?

> `readonly` `optional` **seed?**: `bigint`

Defined in: [packages/prismarine/src/world/Generator.ts:68](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L68)

##### skip?

> `readonly` `optional` **skip?**: (`structure`, `chunkX`, `chunkZ`) => `boolean`

Defined in: [packages/prismarine/src/world/Generator.ts:67](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L67)

Whether to pass over a start the search would otherwise answer, by its structure and start chunk.

###### Parameters

###### structure

`string`

###### chunkX

`number`

###### chunkZ

`number`

###### Returns

`boolean`

##### wanted

> `readonly` **wanted**: (`structure`) => `boolean`

Defined in: [packages/prismarine/src/world/Generator.ts:65](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L65)

Whether a structure identifier is one the caller wants.

A predicate so a caller naming a tag does not have to flatten it first, and so a search
for "any village" costs the same as one for a single identifier.

###### Parameters

###### structure

`string`

###### Returns

`boolean`

##### x

> `readonly` **x**: `number`

Defined in: [packages/prismarine/src/world/Generator.ts:49](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L49)

##### y?

> `readonly` `optional` **y?**: `number`

Defined in: [packages/prismarine/src/world/Generator.ts:51](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L51)

The height searched from, which Java measures distances with. Defaults to 0.

##### z

> `readonly` **z**: `number`

Defined in: [packages/prismarine/src/world/Generator.ts:52](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L52)

***

### StructureSearchResult

Defined in: [packages/prismarine/src/world/Generator.ts:72](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L72)

Where a structure search found something.

#### Properties

##### origin

> `readonly` **origin**: `object`

Defined in: [packages/prismarine/src/world/Generator.ts:84](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L84)

The generation point, where the structure's layout started and its biome was checked.

###### x

> `readonly` **x**: `number`

###### y

> `readonly` **y**: `number`

###### z

> `readonly` **z**: `number`

##### startChunk?

> `readonly` `optional` **startChunk?**: `object`

Defined in: [packages/prismarine/src/world/Generator.ts:86](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L86)

The chunk the structure starts in, which is what tells one start of a structure from another.

###### x

> `readonly` **x**: `number`

###### z

> `readonly` **z**: `number`

##### structure

> `readonly` **structure**: `string`

Defined in: [packages/prismarine/src/world/Generator.ts:74](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L74)

The structure identifier, for example `minecraft:village_plains`.

##### x

> `readonly` **x**: `number`

Defined in: [packages/prismarine/src/world/Generator.ts:80](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L80)

Java's locate position, in blocks: the start chunk's corner moved by the structure set's
`locate_offset`. It is what `/locate` reports and what an eye of ender flies toward, and
its y is the offset's own, 0 for every vanilla set, which Java prints as `~`.

##### y

> `readonly` **y**: `number`

Defined in: [packages/prismarine/src/world/Generator.ts:81](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L81)

##### z

> `readonly` **z**: `number`

Defined in: [packages/prismarine/src/world/Generator.ts:82](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L82)

## Type Aliases

### LocateTagRegistry

> **LocateTagRegistry** = `"worldgen/structure"` \| `"worldgen/biome"`

Defined in: [packages/prismarine/src/world/Generator.ts:117](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L117)

The tag registries a `/locate` name may draw on; see [Generator.membersOfTag](#membersoftag).

***

### SurfaceProbe

> **SurfaceProbe** = \{ `name`: `string`; `y`: `number`; \} \| `undefined`

Defined in: [packages/prismarine/src/world/Generator.ts:32](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/Generator.ts#L32)

The topmost block of a column, as [Generator.surfaceAt](#surfaceat) reports it.

Undefined when the column holds nothing at all, which is what an empty dimension answers
everywhere and a generated one answers nowhere.
