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

# world/EntitySpawn

## Interfaces

### EntitySpawn

Defined in: [packages/prismarine/src/world/EntitySpawn.ts:14](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/EntitySpawn.ts#L14)

A mob world generation decided should exist, recorded rather than created.

The generator builds chunks and knows nothing about the world they will belong to - it has no
entity list to add to, and a chunk may well be generated long before anything asks for it. So a
pass that builds a village says "a villager belongs here" and the world creates it when the
chunk is first loaded.

Deliberately data rather than an `Entity`: an entity needs a `Position`, a position needs a
world, and a world is exactly what the generator does not have.

#### Properties

##### beamTarget?

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

Defined in: [packages/prismarine/src/world/EntitySpawn.ts:27](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/EntitySpawn.ts#L27)

The block an end crystal's beam points at, Java's `crystal_beam_target`.

###### x

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

###### y

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

###### z

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

##### invulnerable?

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

Defined in: [packages/prismarine/src/world/EntitySpawn.ts:33](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/EntitySpawn.ts#L33)

Whether the entity ignores damage, Java's `crystal_invulnerable`.

##### showBottom?

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

Defined in: [packages/prismarine/src/world/EntitySpawn.ts:30](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/EntitySpawn.ts#L30)

Whether an end crystal renders its base plate; absent keeps the client default, true.

##### type

> `readonly` **type**: `string`

Defined in: [packages/prismarine/src/world/EntitySpawn.ts:16](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/EntitySpawn.ts#L16)

The entity's namespace id, e.g. `minecraft:villager`.

##### x

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

Defined in: [packages/prismarine/src/world/EntitySpawn.ts:19](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/EntitySpawn.ts#L19)

Where it stands, in world coordinates. Feet position, as an entity's position is.

##### y

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

Defined in: [packages/prismarine/src/world/EntitySpawn.ts:20](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/EntitySpawn.ts#L20)

##### yaw?

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

Defined in: [packages/prismarine/src/world/EntitySpawn.ts:24](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/EntitySpawn.ts#L24)

Which way it faces, in degrees.

##### z

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

Defined in: [packages/prismarine/src/world/EntitySpawn.ts:21](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/EntitySpawn.ts#L21)

## Functions

### entitySpawnOf()

> **entitySpawnOf**(`value`): [`EntitySpawn`](#entityspawn) \| `undefined`

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

A spawn out of parsed JSON, such as a pending record a fresh chunk's write keeps, or undefined
when it is not one. A field that does not parse is left out.

#### Parameters

##### value

`unknown`

#### Returns

[`EntitySpawn`](#entityspawn) \| `undefined`
