[API reference](https://jsprismarine.dev/api/index.md) / [@jsprismarine/prismarine](https://jsprismarine.dev/api/@jsprismarine/prismarine/index.md) / entity/data/EntityRuntime

# entity/data/EntityRuntime

## Classes

- [EntityRuntime](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/EntityRuntime/classes/EntityRuntime.md)

## Interfaces

### EntityRuntimeOptions

Defined in: [packages/prismarine/src/entity/data/EntityRuntime.ts:826](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/EntityRuntime.ts#L826)

How to build one [EntityRuntime](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/EntityRuntime/classes/EntityRuntime.md).

#### Properties

##### gameEvents?

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

Defined in: [packages/prismarine/src/entity/data/EntityRuntime.ts:838](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/EntityRuntime.ts#L838)

Adds and re-files listeners for entities with `minecraft:vibration_listener`.

###### add()

> **add**(`listener`): (() => `void`) \| `undefined`

###### Parameters

###### listener

[`GameEventListener`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/GameEventListenerRegistry/index.md#gameeventlistener)

###### Returns

(() => `void`) \| `undefined`

###### move()

> **move**(`listener`): `void`

###### Parameters

###### listener

[`GameEventListener`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/GameEventListenerRegistry/index.md#gameeventlistener)

###### Returns

`void`

##### host

> `readonly` **host**: [`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts)

Defined in: [packages/prismarine/src/entity/data/EntityRuntime.ts:836](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/EntityRuntime.ts#L836)

##### world

> `readonly` **world**: [`EntityWorldFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityworldfacts)

Defined in: [packages/prismarine/src/entity/data/EntityRuntime.ts:835](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/EntityRuntime.ts#L835)

#### Methods

##### content()

> **content**(): [`ServerContent`](https://jsprismarine.dev/api/@jsprismarine/prismarine/content/ServerContent/index.md#servercontent)

Defined in: [packages/prismarine/src/entity/data/EntityRuntime.ts:834](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/EntityRuntime.ts#L834)

The built content, read back lazily.

The world adapter is assembled before `buildServerContent` returns, so a
runtime that held the content directly could not be built at all. This
is the same closure `contentWorldViews` takes for the same reason.

###### Returns

[`ServerContent`](https://jsprismarine.dev/api/@jsprismarine/prismarine/content/ServerContent/index.md#servercontent)

##### explosionGuard()?

> `optional` **explosionGuard**(`source`, `blocks`): \{ `cancel`: `true`; \} \| \{ `blocks`: readonly [`BlockPosition`](https://jsprismarine.dev/api/@jsprismarine/engine-systems/index.md#blockposition)[]; \}

Defined in: [packages/prismarine/src/entity/data/EntityRuntime.ts:873](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/EntityRuntime.ts#L873)

Called before a data-driven entity's blast hurts or clears anything, with the blocks it
would clear.

###### Parameters

###### source

[`DataEntity`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/DataEntity/classes/DataEntity.md)

###### blocks

readonly [`BlockPosition`](https://jsprismarine.dev/api/@jsprismarine/engine-systems/index.md#blockposition)[]

###### Returns

\{ `cancel`: `true`; \} \| \{ `blocks`: readonly [`BlockPosition`](https://jsprismarine.dev/api/@jsprismarine/engine-systems/index.md#blockposition)[]; \}

Whether to cancel it, or the blocks to clear instead.

##### healGuard()?

> `optional` **healGuard**(`entity`, `amount`, `cause`): `number`

Defined in: [packages/prismarine/src/entity/data/EntityRuntime.ts:863](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/EntityRuntime.ts#L863)

Called before a heal, with why the entity heals as `EntityHealCause` names it.

###### Parameters

###### entity

[`DataEntity`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/DataEntity/classes/DataEntity.md)

###### amount

`number`

###### cause

[`HealCause`](#healcause)

###### Returns

`number`

The health to give instead, where 0 or less gives none.

##### nextId()?

> `optional` **nextId**(): `number`

Defined in: [packages/prismarine/src/entity/data/EntityRuntime.ts:911](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/EntityRuntime.ts#L911)

Draws the next runtime id, so a host can keep one pool of them.

A goal names a target by runtime id and does not care which index
answers, so the ids of this runtime's entities and of the host's players
have to be drawn from the same counter. A host that keeps its own
entities supplies this; one that does not gets a counter from 1.

###### Returns

`number`

##### onEntityEvent()?

> `optional` **onEntityEvent**(`entity`, `effects`): `void`

Defined in: [packages/prismarine/src/entity/data/EntityRuntime.ts:895](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/EntityRuntime.ts#L895)

Called as a data-driven entity's event applies: its name and the groups it adds and removes.

###### Parameters

###### entity

[`DataEntity`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/DataEntity/classes/DataEntity.md)

###### effects

[`EventEffects`](https://jsprismarine.dev/api/@jsprismarine/entities/index.md#eventeffects)

###### Returns

`void`

##### onExploded()?

> `optional` **onExploded**(`source`, `cleared`): `void`

Defined in: [packages/prismarine/src/entity/data/EntityRuntime.ts:897](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/EntityRuntime.ts#L897)

Called after a data-driven entity's blast went off, with the blocks it cleared.

###### Parameters

###### source

[`DataEntity`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/DataEntity/classes/DataEntity.md)

###### cleared

readonly `object`[]

###### Returns

`void`

##### onHealed()?

> `optional` **onHealed**(`entity`, `amount`, `cause`): `void`

Defined in: [packages/prismarine/src/entity/data/EntityRuntime.ts:865](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/EntityRuntime.ts#L865)

Called after a heal gave health.

###### Parameters

###### entity

[`DataEntity`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/DataEntity/classes/DataEntity.md)

###### amount

`number`

###### cause

[`HealCause`](#healcause)

###### Returns

`void`

##### onHealthChanged()?

> `optional` **onHealthChanged**(`entity`, `before`, `after`): `void`

Defined in: [packages/prismarine/src/entity/data/EntityRuntime.ts:867](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/EntityRuntime.ts#L867)

Called after an entity's health changed, by whatever changed it.

###### Parameters

###### entity

[`DataEntity`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/DataEntity/classes/DataEntity.md)

###### before

`number`

###### after

`number`

###### Returns

`void`

##### onMeleeHit()?

> `optional` **onMeleeHit**(`attacker`, `target`): `void`

Defined in: [packages/prismarine/src/entity/data/EntityRuntime.ts:858](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/EntityRuntime.ts#L858)

Called when a mob's melee swing reaches its target, before the blow.

###### Parameters

###### attacker

[`DataEntity`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/DataEntity/classes/DataEntity.md)

###### target

`number`

###### Returns

`void`

##### onProjectileHit()?

> `optional` **onProjectileHit**(`projectile`, `hit`, `at`, `velocity`): `void`

Defined in: [packages/prismarine/src/entity/data/EntityRuntime.ts:881](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/EntityRuntime.ts#L881)

Called when a projectile reaches an entity or a block, before what the hit does.

###### Parameters

###### projectile

[`DataEntity`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/DataEntity/classes/DataEntity.md)

###### hit

\{ `entity`: `number`; \} \| \{ `block`: [`EntityPosition`](https://jsprismarine.dev/api/@jsprismarine/entities/index.md#entityposition); \}

###### at

[`EntityPosition`](https://jsprismarine.dev/api/@jsprismarine/entities/index.md#entityposition)

###### velocity

[`EntityPosition`](https://jsprismarine.dev/api/@jsprismarine/entities/index.md#entityposition)

The projectile's motion as it hit, which `hitVector` reads.

###### Returns

`void`

##### onRemove()?

> `optional` **onRemove**(`entity`, `reason`): `void`

Defined in: [packages/prismarine/src/entity/data/EntityRuntime.ts:854](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/EntityRuntime.ts#L854)

Called once per entity, after it has left the index.

###### Parameters

###### entity

[`DataEntity`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/DataEntity/classes/DataEntity.md)

###### reason

`string`

###### Returns

`void`

##### onRemoving()?

> `optional` **onRemoving**(`entity`, `reason`): `void`

Defined in: [packages/prismarine/src/entity/data/EntityRuntime.ts:856](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/EntityRuntime.ts#L856)

Called once per entity about to be removed, while it is still in the store and the index.

###### Parameters

###### entity

[`DataEntity`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/DataEntity/classes/DataEntity.md)

###### reason

`string`

###### Returns

`void`

##### onSpawn()?

> `optional` **onSpawn**(`entity`, `cause`): `void`

Defined in: [packages/prismarine/src/entity/data/EntityRuntime.ts:852](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/EntityRuntime.ts#L852)

Called once per entity, after its spawn event has run.

This is how a server that has to show an entity to a client learns that
one exists. The runtime's index is the behavior; the body a client is
sent is the host's, and it is created here rather than by every caller
of [EntityRuntime.spawn](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/EntityRuntime/classes/EntityRuntime.md#spawn).

###### Parameters

###### entity

[`DataEntity`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/DataEntity/classes/DataEntity.md)

###### cause

[`EntitySpawnCause`](https://jsprismarine.dev/api/@jsprismarine/prismarine/events/entity/EntitySpawnEvent/index.md#entityspawncause)

###### Returns

`void`

##### onTamed()?

> `optional` **onTamed**(`entity`, `tamer`): `void`

Defined in: [packages/prismarine/src/entity/data/EntityRuntime.ts:893](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/EntityRuntime.ts#L893)

Called once an entity was tamed.

###### Parameters

###### entity

[`DataEntity`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/DataEntity/classes/DataEntity.md)

###### tamer

`number`

###### Returns

`void`

##### report()?

> `optional` **report**(`message`): `void`

Defined in: [packages/prismarine/src/entity/data/EntityRuntime.ts:843](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/EntityRuntime.ts#L843)

Receives everything the runtime met and could not carry out.

###### Parameters

###### message

`string`

###### Returns

`void`

##### shownAs()?

> `optional` **shownAs**(`entity`): `string` \| `undefined`

Defined in: [packages/prismarine/src/entity/data/EntityRuntime.ts:902](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/EntityRuntime.ts#L902)

The type clients are shown an entity as when it is not the entity's own, such as the type an
inert actor was saved with, which its saved form carries as `shownAs`.

###### Parameters

###### entity

[`DataEntity`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/DataEntity/classes/DataEntity.md)

###### Returns

`string` \| `undefined`

##### tameGuard()?

> `optional` **tameGuard**(`entity`, `tamer`): `boolean`

Defined in: [packages/prismarine/src/entity/data/EntityRuntime.ts:891](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/EntityRuntime.ts#L891)

Called before an entity is tamed, with the runtime id of who tames it.

###### Parameters

###### entity

[`DataEntity`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/DataEntity/classes/DataEntity.md)

###### tamer

`number`

###### Returns

`boolean`

Whether the taming goes on.

***

### RuntimeEntityHostFacts

Defined in: [packages/prismarine/src/entity/data/EntityRuntime.ts:915](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/EntityRuntime.ts#L915)

The host view exposed to the runtime, with its per-tick player index.

#### Extends

- [`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts)

#### Methods

##### applySonicBoom()?

> `optional` **applySonicBoom**(`id`, `amount`, `sourceId`, `impulse`): `void`

Defined in: [packages/prismarine/src/entity/data/host.ts:364](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/host.ts#L364)

Hurts an external target, then applies the warden's three-dimensional impulse if it lands.

###### Parameters

###### id

`number`

###### amount

`number`

###### sourceId

`number`

###### impulse

[`ContentPosition`](https://jsprismarine.dev/api/@jsprismarine/prismarine/content/world/adapter/index.md#contentposition)

###### Returns

`void`

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`applySonicBoom`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#applysonicboom)

##### applyStatusEffect()?

> `optional` **applyStatusEffect**(`id`, `effect`): `void`

Defined in: [packages/prismarine/src/entity/data/host.ts:252](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/host.ts#L252)

Applies a data-defined melee effect to a live entity or player.

###### Parameters

###### id

`number`

###### effect

[`StatusEffectInput`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/StatusEffect/index.md#statuseffectinput)

###### Returns

`void`

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`applyStatusEffect`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#applystatuseffect)

##### applyStatusEffectIfChanged()?

> `optional` **applyStatusEffectIfChanged**(`id`, `effect`): `boolean`

Defined in: [packages/prismarine/src/entity/data/host.ts:254](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/host.ts#L254)

Applies an effect and reports whether its active state changed.

###### Parameters

###### id

`number`

###### effect

[`StatusEffectInput`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/StatusEffect/index.md#statuseffectinput)

###### Returns

`boolean`

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`applyStatusEffectIfChanged`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#applystatuseffectifchanged)

##### attackSound()?

> `optional` **attackSound**(`id`): `void`

Defined in: [packages/prismarine/src/entity/data/host.ts:242](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/host.ts#L242)

Plays the attack sound for a data-driven entity.

###### Parameters

###### id

`number`

###### Returns

`void`

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`attackSound`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#attacksound)

##### boostGlider()?

> `optional` **boostGlider**(`id`, `ticks`): `void`

Defined in: [packages/prismarine/src/entity/data/host.ts:227](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/host.ts#L227)

Tells a gliding player's client that a firework rocket boosts it for `ticks`; the client
flies the boost, as it moves its own player.

###### Parameters

###### id

`number`

###### ticks

`number`

###### Returns

`void`

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`boostGlider`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#boostglider)

##### breakMinedBlock()?

> `optional` **breakMinedBlock**(`playerId`, `mining`): `void`

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

Breaks the block a store player mines for a client that never reports the break, once the
player has mined it for long enough, through the input step as the client's own report of
the break would. Called every tick of such mining; the break ends it. Left out, such a
block never breaks.

###### Parameters

###### playerId

`number`

###### mining

[`PlayerMining`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/playerComponents/index.md#playermining)

###### Returns

`void`

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`breakMinedBlock`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#breakminedblock)

##### damageCommitted()?

> `optional` **damageCommitted**(`commit`): `void`

Defined in: [packages/prismarine/src/entity/data/host.ts:387](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/host.ts#L387)

Hears every committed blow on a data-driven entity, after its health changed and before a
death it caused removes it. The host raises its damage and death events and its advancement
triggers from here.

###### Parameters

###### commit

[`DamageCommit`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#damagecommit)

###### Returns

`void`

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`damageCommitted`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#damagecommitted)

##### damageMitigation()?

> `optional` **damageMitigation**(`target`, `intent`): [`DamageMitigation`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/damageStages/index.md#damagemitigation) \| `undefined`

Defined in: [packages/prismarine/src/entity/data/host.ts:381](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/host.ts#L381)

What a data-driven entity wears against one blow: armor points, toughness and protection.

###### Parameters

###### target

[`DataEntity`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/DataEntity/classes/DataEntity.md)

###### intent

[`DamageIntent`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/damagePipeline/index.md#damageintent)

###### Returns

[`DamageMitigation`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/damageStages/index.md#damagemitigation) \| `undefined`

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`damageMitigation`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#damagemitigation)

##### destroyBlock()?

> `optional` **destroyBlock**(`at`, `options`): `boolean`

Defined in: [packages/prismarine/src/entity/data/host.ts:122](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/host.ts#L122)

Raises a block's `onBreak` and puts what it yields on the ground.

The write is still the caller's: this is the half of a destruction the runtime cannot
do itself. Raising the hook is what spills a chest a creeper blew up, and the drops a
family makes while it runs have to be told apart from the loot table's own roll,
which needs the world those drops go to. `src/world/blockDestroy.ts` is the one place
that knows how.

Call it before writing over the block, because a family reads the block entity it is
about to lose.

Left out by a host with no live world behind it, which makes the caller roll the
table itself and leave the hook unraised, the way it did before this existed.

###### Parameters

###### at

[`ContentPosition`](https://jsprismarine.dev/api/@jsprismarine/prismarine/content/world/adapter/index.md#contentposition)

###### options

###### dropsBlock?

`boolean`

Whether the block yields anything of itself, which is the
  `doTileDrops` game rule. It still spills what it was holding either way.

###### explosionRadius?

`number`

###### sourceId?

`number`

###### Returns

`boolean`

True when the host took the drops, so the caller owes nothing more for them.

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`destroyBlock`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#destroyblock)

##### drop()

> **drop**(`at`, `item`): `void`

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

Drops an item stack as an entity at a position.

###### Parameters

###### at

[`ContentPosition`](https://jsprismarine.dev/api/@jsprismarine/prismarine/content/world/adapter/index.md#contentposition)

###### item

[`ItemDrop`](https://jsprismarine.dev/api/@jsprismarine/block-behaviors/index.md#itemdrop)

###### Returns

`void`

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`drop`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#drop)

##### entitySound()?

> `optional` **entitySound**(`id`, `event`): `void`

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

Plays a level sound event as a data-driven entity's own, such as the `ambient` an entity
file's `play_sound` names, which a client plays in the entity type's voice. Left out, the
name plays as a sound definition.

###### Parameters

###### id

`number`

The entity's runtime id.

###### event

[`LevelSoundEvent`](https://jsprismarine.dev/api/@jsprismarine/minecraft/index.md#levelsoundevent)

The level sound event.

###### Returns

`void`

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`entitySound`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entitysound)

##### explosionHit()?

> `optional` **explosionHit**(`at`): `void`

Defined in: [packages/prismarine/src/entity/data/host.ts:321](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/host.ts#L321)

Runs the `onExplosionHit` hook of the block at `at`, which a blast that triggers blocks
reached, as Java's `ServerExplosion.interactWithBlocks` does for a wind charge's burst.
Left out by a host with no live world, where nothing is triggered.

###### Parameters

###### at

[`ContentPosition`](https://jsprismarine.dev/api/@jsprismarine/prismarine/content/world/adapter/index.md#contentposition)

The block's position.

###### Returns

`void`

###### Java See

ServerExplosion.interactWithBlocks

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`explosionHit`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#explosionhit)

##### fallingBlockLanded()?

> `optional` **fallingBlockLanded**(`id`, `at`): `void`

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

A falling block came to rest as a block, which the players tracking it are shown at once,
before the block change reaches them.

###### Parameters

###### id

`number`

The falling block's runtime id, which is gone by the time it is shown.

###### at

[`ContentPosition`](https://jsprismarine.dev/api/@jsprismarine/prismarine/content/world/adapter/index.md#contentposition)

The block it became.

###### Returns

`void`

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`fallingBlockLanded`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#fallingblocklanded)

##### finishMeal()?

> `optional` **finishMeal**(`playerId`, `item`): `void`

Defined in: [packages/prismarine/src/entity/data/host.ts:204](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/host.ts#L204)

Finishes a store player's meal: the item in hand runs `onConsume`, which feeds the player
and hands back what the meal leaves. Left out, a finished meal does nothing.

###### Parameters

###### playerId

`number`

###### item

`string`

###### Returns

`void`

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`finishMeal`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#finishmeal)

##### fireworkExploded()?

> `optional` **fireworkExploded**(`id`): `void`

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

Shows a firework rocket's explosion to the players that see it, before it leaves the world.

###### Parameters

###### id

`number`

###### Returns

`void`

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`fireworkExploded`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#fireworkexploded)

##### fireworkLaunched()?

> `optional` **fireworkLaunched**(`id`, `at`): `void`

Defined in: [packages/prismarine/src/entity/data/host.ts:220](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/host.ts#L220)

Plays a firework rocket's launch where it starts, on its first tick.

###### Parameters

###### id

`number`

###### at

[`ContentPosition`](https://jsprismarine.dev/api/@jsprismarine/prismarine/content/world/adapter/index.md#contentposition)

###### Returns

`void`

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`fireworkLaunched`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#fireworklaunched)

##### givePlayerItem()?

> `optional` **givePlayerItem**(`playerId`, `itemId`, `item`): `number`

Defined in: [packages/prismarine/src/entity/data/host.ts:157](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/host.ts#L157)

Gives a dropped stack to a player: the inventory, the take animation and the advancement.

###### Parameters

###### playerId

`number`

The runtime id of the player taking it.

###### itemId

`number`

The runtime id of the dropped stack, which the take animation names.

###### item

[`ItemDrop`](https://jsprismarine.dev/api/@jsprismarine/block-behaviors/index.md#itemdrop)

The stack.

###### Returns

`number`

How many of the stack's items did not fit. Left out, nothing is ever taken.

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`givePlayerItem`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#giveplayeritem)

##### handsOf()?

> `optional` **handsOf**(`playerId`): [`PlayerHands`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#playerhands) \| `undefined`

Defined in: [packages/prismarine/src/entity/data/host.ts:188](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/host.ts#L188)

What a store player holds in each hand, by identifier, which the store does not model yet.
Left out, or answering undefined, the entity's own equipment stands for it.

###### Parameters

###### playerId

`number`

###### Returns

[`PlayerHands`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#playerhands) \| `undefined`

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`handsOf`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#handsof)

##### heldItemOf()?

> `optional` **heldItemOf**(`playerId`): `string` \| `undefined`

Defined in: [packages/prismarine/src/entity/data/host.ts:177](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/host.ts#L177)

The item a store player holds in its main hand, by identifier, or undefined for an empty
hand. Left out by a host that keeps no inventory for store players, such as a test's.

###### Parameters

###### playerId

`number`

###### Returns

`string` \| `undefined`

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`heldItemOf`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#helditemof)

##### hurt()?

> `optional` **hurt**(`id`, `amount`, `cause`, `sourceId`, `deathMessageOverride?`): `void`

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

Deals damage to something the entity index does not hold.

A player is the case that matters: a zombie's `melee_attack` goal names
its target by runtime id, and a player's id belongs to the server's own
entity list rather than to this index. Left out by a server that cannot
route damage, which makes a mob swing and connect with nothing rather
than silently pretending it hit.

###### Parameters

###### id

`number`

The runtime id of whatever is being hurt.

###### amount

`number`

###### cause

`string`

###### sourceId

`number` \| `undefined`

The runtime id of the entity answerable for the blow.

###### deathMessageOverride?

`string`

###### Returns

`void`

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`hurt`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#hurt)

##### hurtByProjectile()?

> `optional` **hurtByProjectile**(`id`, `amount`, `projectileId`, `ownerId`): `void`

Defined in: [packages/prismarine/src/entity/data/host.ts:258](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/host.ts#L258)

Deals damage to an entity with the projectile and its owner preserved as the source.

###### Parameters

###### id

`number`

###### amount

`number`

###### projectileId

`number`

###### ownerId

`number` \| `undefined`

###### Returns

`void`

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`hurtByProjectile`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#hurtbyprojectile)

##### hurtFeedback()?

> `optional` **hurtFeedback**(`id`, `blow`): `void`

Defined in: [packages/prismarine/src/entity/data/host.ts:264](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/host.ts#L264)

Sends the hurt animation and entity-attributed sound for one runtime-applied hit.

###### Parameters

###### id

`number`

The data-driven entity's runtime id.

###### blow

[`HurtBlow`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#hurtblow)

What hurt it.

###### Returns

`void`

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`hurtFeedback`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#hurtfeedback)

##### itemBurnedAway()?

> `optional` **itemBurnedAway**(`itemId`, `at`): `void`

Defined in: [packages/prismarine/src/entity/data/host.ts:172](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/host.ts#L172)

Plays the hiss of a dropped stack that lava burned away, at the point it lay.

###### Parameters

###### itemId

`number`

###### at

[`EntityPosition`](https://jsprismarine.dev/api/@jsprismarine/entities/index.md#entityposition)

###### Returns

`void`

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`itemBurnedAway`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#itemburnedaway)

##### itemCooldown()?

> `optional` **itemCooldown**(`id`, `category`, `ticks`): `void`

Defined in: [packages/prismarine/src/entity/data/host.ts:347](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/host.ts#L347)

Starts an item cooldown on a player's client, as Java's `ItemCooldowns.addCooldown` reaches
it with a cooldown packet. Nothing is sent for a runtime id no client watches as itself.

###### Parameters

###### id

`number`

The player's runtime id.

###### category

`string`

The Bedrock cooldown category, such as `shield`.

###### ticks

`number`

How long the cooldown runs.

###### Returns

`void`

###### Java See

ItemCooldowns.addCooldown(Lnet/minecraft/resources/Identifier;I)V

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`itemCooldown`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#itemcooldown)

##### items()?

> `optional` **items**(): readonly [`ContentItemEntity`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#contentitementity)[]

Defined in: [packages/prismarine/src/entity/data/host.ts:132](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/host.ts#L132)

Every item stack lying in the dimension.

Left out by a server whose item entities are not indexed, which makes
the pickup goals find nothing rather than find a guess.

###### Returns

readonly [`ContentItemEntity`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#contentitementity)[]

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`items`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#items)

##### itemsNear()?

> `optional` **itemsNear**(`center`, `radius`): readonly [`ContentItemEntity`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#contentitementity)[]

Defined in: [packages/prismarine/src/entity/data/host.ts:139](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/host.ts#L139)

Item stacks whose horizontal positions may be inside a pickup radius.

The runtime still applies the exact three-dimensional radius and nearest-first ordering.
A live host can use its spatial index here; hosts without one retain [items](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#items).

###### Parameters

###### center

[`ContentPosition`](https://jsprismarine.dev/api/@jsprismarine/prismarine/content/world/adapter/index.md#contentposition)

###### radius

`number`

###### Returns

readonly [`ContentItemEntity`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#contentitementity)[]

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`itemsNear`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#itemsnear)

##### itemStackChanged()?

> `optional` **itemStackChanged**(`itemId`, `count`): `void`

Defined in: [packages/prismarine/src/entity/data/host.ts:170](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/host.ts#L170)

Tells clients that a dropped stack now holds `count` items, after a merge or a partial take.

###### Parameters

###### itemId

`number`

###### count

`number`

###### Returns

`void`

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`itemStackChanged`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#itemstackchanged)

##### knockback()?

> `optional` **knockback**(`id`, `directionX`, `directionZ`, `strength`): `void`

Defined in: [packages/prismarine/src/entity/data/host.ts:362](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/host.ts#L362)

Applies projectile knockback to an entity outside the data-driven index.

###### Parameters

###### id

`number`

###### directionX

`number`

###### directionZ

`number`

###### strength

`number`

###### Returns

`void`

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`knockback`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#knockback)

##### levelEvent()?

> `optional` **levelEvent**(`at`, `event`, `data`): `void`

Defined in: [packages/prismarine/src/entity/data/host.ts:218](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/host.ts#L218)

Plays a level event at a point, such as the burst of an eye of ender that shatters.

###### Parameters

###### at

[`ContentPosition`](https://jsprismarine.dev/api/@jsprismarine/prismarine/content/world/adapter/index.md#contentposition)

###### event

`number`

###### data

`number`

###### Returns

`void`

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`levelEvent`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#levelevent)

##### lightningStruck()?

> `optional` **lightningStruck**(`at`, `fire`): `void`

Defined in: [packages/prismarine/src/entity/data/host.ts:330](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/host.ts#L330)

Does a lightning strike's work on the blocks: a fire where the bolt stands and four more
round it when `fire` holds, and the lightning rod under it powered.

###### Parameters

###### at

[`ContentPosition`](https://jsprismarine.dev/api/@jsprismarine/prismarine/content/world/adapter/index.md#contentposition)

The block the bolt stands in.

###### fire

`boolean`

Whether the strike sets fire, which the runtime decides from the difficulty and
  how far fire spreads from a player.

###### Returns

`void`

###### Java See

LightningBolt.spawnFire

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`lightningStruck`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#lightningstruck)

##### lootLevel()?

> `optional` **lootLevel**(): [`LevelView`](https://jsprismarine.dev/api/@jsprismarine/predicates/index.md#levelview) \| `undefined`

Defined in: [packages/prismarine/src/entity/data/host.ts:183](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/host.ts#L183)

The world as a loot roll reads it, which a trade's `exploration_map` searches for its
structure. Left out, or answering undefined, an explorer map trade finds nothing and makes
no offer.

###### Returns

[`LevelView`](https://jsprismarine.dev/api/@jsprismarine/predicates/index.md#levelview) \| `undefined`

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`lootLevel`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#lootlevel)

##### mobEventActive()

> **mobEventActive**(`event`): `boolean`

Defined in: [packages/prismarine/src/entity/data/host.ts:370](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/host.ts#L370)

Whether a named mob event, such as `minecraft:pillager_patrols_event`, is running.

###### Parameters

###### event

`string`

###### Returns

`boolean`

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`mobEventActive`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#mobeventactive)

##### playerById()

> **playerById**(`id`): [`ContentEntity`](https://jsprismarine.dev/api/@jsprismarine/prismarine/content/world/adapter/index.md#contententity) \| `undefined`

Defined in: [packages/prismarine/src/entity/data/EntityRuntime.ts:916](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/EntityRuntime.ts#L916)

One player in the dimension by runtime id, when the host can index players directly.

###### Parameters

###### id

`number`

###### Returns

[`ContentEntity`](https://jsprismarine.dev/api/@jsprismarine/prismarine/content/world/adapter/index.md#contententity) \| `undefined`

###### Overrides

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`playerById`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#playerbyid)

##### playerEvent()?

> `optional` **playerEvent**(`playerId`, `event`): `void`

Defined in: [packages/prismarine/src/entity/data/host.ts:271](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/host.ts#L271)

Tells a player's client something that happened to the player alone, such as a pufferfish's
sting or an elder guardian's curse.

###### Parameters

###### playerId

`number`

The player's runtime id.

###### event

[`ShownPlayerEvent`](https://jsprismarine.dev/api/@jsprismarine/prismarine/player/presenter/SessionPresenter/index.md#shownplayerevent)

What happened.

###### Returns

`void`

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`playerEvent`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#playerevent)

##### playerIdentityOf()?

> `optional` **playerIdentityOf**(`id`): `string` \| `undefined`

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

Stable identity of a player runtime id, or undefined when it names no player.

###### Parameters

###### id

`number`

###### Returns

`string` \| `undefined`

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`playerIdentityOf`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#playeridentityof)

##### playerIdForIdentity()?

> `optional` **playerIdForIdentity**(`identity`): `number` \| `undefined`

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

Current runtime id of a stable player identity, or undefined while that player is offline.

###### Parameters

###### identity

`string`

###### Returns

`number` \| `undefined`

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`playerIdForIdentity`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#playeridforidentity)

##### playerRidingInLava()?

> `optional` **playerRidingInLava**(`id`, `start`): `void`

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

A player's vehicle is in lava, and has been since `start`, where the player was when the
vehicle went in.

###### Parameters

###### id

`number`

The player's runtime id.

###### start

[`EntityPosition`](https://jsprismarine.dev/api/@jsprismarine/entities/index.md#entityposition)

Where the player was when its vehicle went into the lava.

###### Returns

`void`

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`playerRidingInLava`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#playerridinginlava)

##### players()

> **players**(): readonly [`ContentEntity`](https://jsprismarine.dev/api/@jsprismarine/prismarine/content/world/adapter/index.md#contententity)[]

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

Every player in the dimension.

###### Returns

readonly [`ContentEntity`](https://jsprismarine.dev/api/@jsprismarine/prismarine/content/world/adapter/index.md#contententity)[]

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`players`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#players)

##### playerStartedRiding()?

> `optional` **playerStartedRiding**(`id`): `void`

Defined in: [packages/prismarine/src/entity/data/host.ts:298](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/host.ts#L298)

A player got on a vehicle.

###### Parameters

###### id

`number`

The player's runtime id.

###### Returns

`void`

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`playerStartedRiding`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#playerstartedriding)

##### playerView()?

> `optional` **playerView**(`id`): [`FilterEntityView`](https://jsprismarine.dev/api/@jsprismarine/entities/index.md#filterentityview) \| `undefined`

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

A live player's full entity-filter view, or undefined when the player has left.

###### Parameters

###### id

`number`

###### Returns

[`FilterEntityView`](https://jsprismarine.dev/api/@jsprismarine/entities/index.md#filterentityview) \| `undefined`

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`playerView`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#playerview)

##### playSoundAt()?

> `optional` **playSoundAt**(`at`, `sound`): `void`

Defined in: [packages/prismarine/src/entity/data/host.ts:216](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/host.ts#L216)

Plays a named sound at an exact point, for an entity rather than a block, which
`ContentEffectSink.playSound` centers on.

###### Parameters

###### at

[`ContentPosition`](https://jsprismarine.dev/api/@jsprismarine/prismarine/content/world/adapter/index.md#contentposition)

###### sound

`string`

###### Returns

`void`

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`playSoundAt`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#playsoundat)

##### projectileHitBlock()?

> `optional` **projectileHitBlock**(`at`, `hit`): `void`

Defined in: [packages/prismarine/src/entity/data/host.ts:338](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/host.ts#L338)

Runs the `onProjectileHit` hook of the block at `at`, which a projectile flew into, as Java's
`Projectile.onHitBlock` does. Left out by a host with no live world.

###### Parameters

###### at

[`ContentPosition`](https://jsprismarine.dev/api/@jsprismarine/prismarine/content/world/adapter/index.md#contentposition)

The block's position.

###### hit

`Omit`\<[`BlockProjectileHitEvent`](https://jsprismarine.dev/api/@jsprismarine/blocks/index.md#blockprojectilehitevent), `"block"`\>

What the block's rule reads of the projectile.

###### Returns

`void`

###### Java See

Projectile.onHitBlock

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`projectileHitBlock`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#projectilehitblock)

##### removeStatusEffect()?

> `optional` **removeStatusEffect**(`id`, `identifier`): `boolean`

Defined in: [packages/prismarine/src/entity/data/host.ts:256](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/host.ts#L256)

Removes one effect from a live entity or player.

###### Parameters

###### id

`number`

###### identifier

`string`

###### Returns

`boolean`

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`removeStatusEffect`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#removestatuseffect)

##### riderDismounted()?

> `optional` **riderDismounted**(`id`, `at`): `void`

Defined in: [packages/prismarine/src/entity/data/host.ts:293](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/host.ts#L293)

Puts a player its vehicle let off where the vehicle sets it down, as Java's
`ServerPlayer.dismountTo` teleports the player there.

###### Parameters

###### id

`number`

The player's runtime id.

###### at

[`EntityPosition`](https://jsprismarine.dev/api/@jsprismarine/entities/index.md#entityposition)

Where the vehicle lets it off.

###### Returns

`void`

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`riderDismounted`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#riderdismounted)

##### showDeath()?

> `optional` **showDeath**(`id`, `stage`): `void`

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

Shows a step of a living entity's death to the players that see it: the death animation
starting, the body vanishing at its end, or a dead player standing again.

###### Parameters

###### id

`number`

The runtime id of the entity that died, or of the player that came back.

###### stage

[`DeathStage`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/changelog/ChangeEntry/index.md#deathstage)

Which step it is.

###### Returns

`void`

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`showDeath`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#showdeath)

##### startDeathAnimation()?

> `optional` **startDeathAnimation**(`id`): `void`

Defined in: [packages/prismarine/src/entity/data/host.ts:360](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/host.ts#L360)

Announces that an entity's data-defined death hold began, so clients play the long
death animation. Only the ender dragon's `minecraft:behavior.dragondeath` starts one.

###### Parameters

###### id

`number`

The data-driven entity's runtime id.

###### Returns

`void`

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`startDeathAnimation`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#startdeathanimation)

##### stepOn()?

> `optional` **stepOn**(`at`, `entity`): `void`

Defined in: [packages/prismarine/src/entity/data/host.ts:313](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/host.ts#L313)

Runs the `onStepOn` hook of the block at `at`, which a body's box has just moved into, as
Java's `Entity.checkInsideBlocks` calls `entityInside`.

###### Parameters

###### at

[`EntityPosition`](https://jsprismarine.dev/api/@jsprismarine/entities/index.md#entityposition)

The block's position.

###### entity

[`DataEntity`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/DataEntity/classes/DataEntity.md)

The body that moved into it.

###### Returns

`void`

###### Java See

Entity.checkInsideBlocks(Lnet/minecraft/world/phys/Vec3;Lnet/minecraft/world/phys/Vec3;Lnet/minecraft/world/entity/InsideBlockEffectApplier$StepBasedCollector;Lit/unimi/dsi/fastutil/longs/LongSet;I)I

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`stepOn`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#stepon)

##### structureSpawnOverrideAt()?

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

Defined in: [packages/prismarine/src/entity/data/host.ts:379](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/host.ts#L379)

Whether Java structure spawn data reserves this type at one position.

###### Parameters

###### identifier

`string`

###### at

[`ContentPosition`](https://jsprismarine.dev/api/@jsprismarine/prismarine/content/world/adapter/index.md#contentposition)

###### Returns

`boolean` \| `undefined`

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`structureSpawnOverrideAt`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#structurespawnoverrideat)

##### takeExperienceOrb()?

> `optional` **takeExperienceOrb**(`playerId`, `orbId`, `value`): `void`

Defined in: [packages/prismarine/src/entity/data/host.ts:168](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/host.ts#L168)

Gives a player one experience orb, Java's `ExperienceOrb.playerTouch`: Mending repairs what
it can of the player's gear and the rest of the points are experience. Left out, an orb a
player takes is lost.

###### Parameters

###### playerId

`number`

The runtime id of the player taking it.

###### orbId

`number`

The runtime id of the orb.

###### value

`number`

The points one orb is worth.

###### Returns

`void`

###### Java See

ExperienceOrb.playerTouch

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`takeExperienceOrb`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#takeexperienceorb)

##### takeItem()?

> `optional` **takeItem**(`id`, `count?`): [`ItemDrop`](https://jsprismarine.dev/api/@jsprismarine/block-behaviors/index.md#itemdrop) \| `undefined`

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

Takes items from one item entity, removing it when the whole stack was taken.

###### Parameters

###### id

`number`

The runtime id of the dropped stack.

###### count?

`number`

The maximum number to take, or all items when omitted.

###### Returns

[`ItemDrop`](https://jsprismarine.dev/api/@jsprismarine/block-behaviors/index.md#itemdrop) \| `undefined`

What was taken, or undefined when nothing of that id is lying
  there, which is what two mobs reaching for the same stack get.

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`takeItem`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#takeitem)

##### useDeathProtection()?

> `optional` **useDeathProtection**(`playerId`): `unknown`

Defined in: [packages/prismarine/src/entity/data/host.ts:199](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/host.ts#L199)

Uses up one death protection item, a totem of undying, from a store player's main hand or
else its off hand, and answers with its `minecraft:death_protection` component. Undefined
when neither hand holds one. Left out, a store player's totems save nothing.

###### Parameters

###### playerId

`number`

###### Returns

`unknown`

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`useDeathProtection`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#usedeathprotection)

##### villageBorderDistance()?

> `optional` **villageBorderDistance**(`at`): `number` \| `undefined`

Defined in: [packages/prismarine/src/entity/data/host.ts:377](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/host.ts#L377)

How far a position is from the nearest village border, negative inside
it and undefined when no village is near. Left out by a server with no
village index, which makes `minecraft:player_in_village_filter` refuse
rather than match everywhere.

###### Parameters

###### at

[`ContentPosition`](https://jsprismarine.dev/api/@jsprismarine/prismarine/content/world/adapter/index.md#contentposition)

###### Returns

`number` \| `undefined`

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`villageBorderDistance`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#villageborderdistance)

##### villagerRaidEffect()?

> `optional` **villagerRaidEffect**(`id`, `effect`): `void`

Defined in: [packages/prismarine/src/entity/data/host.ts:368](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/host.ts#L368)

Performs a world-owned effect requested by a villager raid behavior.

###### Parameters

###### id

`number`

###### effect

[`VillagerRaidEffect`](https://jsprismarine.dev/api/@jsprismarine/entity-brains/index.md#villagerraideffect-1)

###### Returns

`void`

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`villagerRaidEffect`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#villagerraideffect)

##### villagerRaidStateAt()?

> `optional` **villagerRaidStateAt**(`at`): [`VillagerRaidState`](https://jsprismarine.dev/api/@jsprismarine/entity-brains/index.md#villagerraidstate-2) \| `undefined`

Defined in: [packages/prismarine/src/entity/data/host.ts:366](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/host.ts#L366)

The raid facts at a position, supplied by the world raid owner.

###### Parameters

###### at

[`ContentPosition`](https://jsprismarine.dev/api/@jsprismarine/prismarine/content/world/adapter/index.md#contentposition)

###### Returns

[`VillagerRaidState`](https://jsprismarine.dev/api/@jsprismarine/entity-brains/index.md#villagerraidstate-2) \| `undefined`

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`villagerRaidStateAt`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#villagerraidstateat)

##### wakePlayer()?

> `optional` **wakePlayer**(`id`): `boolean`

Defined in: [packages/prismarine/src/entity/data/host.ts:286](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/host.ts#L286)

Gets a player out of bed the way anything but morning wakes it, as a blow does: the players
that see it watch it get up, its client is put beside the bed, and the count of sleepers
is told again.

###### Parameters

###### id

`number`

The player's runtime id.

###### Returns

`boolean`

Whether the player's world woke it; a player in no world is left to the runtime.

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`wakePlayer`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#wakeplayer)

##### wearHeldItem()?

> `optional` **wearHeldItem**(`playerId`, `hand`, `amount`): `void`

Defined in: [packages/prismarine/src/entity/data/host.ts:193](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/host.ts#L193)

Spends durability of what a store player holds in one hand, as a blocked blow wears a
shield. A stack worn through breaks. Left out, the entity's own equipment is worn.

###### Parameters

###### playerId

`number`

###### hand

keyof [`PlayerHands`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#playerhands)

###### amount

`number`

###### Returns

`void`

###### Inherited from

[`EntityHostFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#entityhostfacts).[`wearHeldItem`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/host/index.md#wearhelditem)

## Type Aliases

### HealCause

> **HealCause** = `"Heal"` \| `"Regeneration"` \| `"SelfHeal"` \| `"TotemOfUndying"`

Defined in: [packages/prismarine/src/entity/data/EntityRuntime.ts:515](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/EntityRuntime.ts#L515)

Why an entity heals, as the Script API's `EntityHealCause` names it.

***

### PlayerInputTarget

> **PlayerInputTarget** = `Pick`\<[`StorePlayer`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/storePlayer/classes/StorePlayer.md), `"entity"` \| `"getComponents"`\>

Defined in: [packages/prismarine/src/entity/data/EntityRuntime.ts:823](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/EntityRuntime.ts#L823)

A store player as the runtime's player inputs take it: its entity while it has one, and its
components, which take an input themselves while the player is in no store.

## Variables

### PROJECTILE\_EYE\_HEIGHT\_FRACTION

> `const` **PROJECTILE\_EYE\_HEIGHT\_FRACTION**: `0.85` = `ENTITY_EYE_HEIGHT_FRACTION`

Defined in: [packages/prismarine/src/entity/data/EntityRuntime.ts:704](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/EntityRuntime.ts#L704)

The default eye position as a fraction of a non-player entity's hitbox height.

## Functions

### acceptsStatusEffect()

> **acceptsStatusEffect**(`entity`, `identifier`): `boolean`

Defined in: [packages/prismarine/src/entity/data/EntityRuntime.ts:691](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/EntityRuntime.ts#L691)

Whether an active data-driven entity accepts the named status effect: not when its
`minecraft:mob_effect_immunity` names it, nor when Java's `canBeAffected` refuses it the
effect by its entity type tags or its class.

#### Parameters

##### entity

[`EntityInstance`](https://jsprismarine.dev/api/@jsprismarine/entities/classes/EntityInstance.md)

##### identifier

`string`

#### Returns

`boolean`

## References

### EntityFacts

Re-exports [EntityFacts](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/facts/index.md#entityfacts)
