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

# entity/playerShown

## Type Aliases

### PlayerShownForm

> **PlayerShownForm** = `object`

Defined in: [packages/prismarine/src/entity/playerShown.ts:55](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/playerShown.ts#L55)

A player's shown form: each shown field by the name its entries carry, and each shown slot by
its [slotKey](#slotkey).

#### Properties

##### fields

> `readonly` **fields**: [`PlainRecord`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/changelog/PlainData/index.md#plainrecord)

Defined in: [packages/prismarine/src/entity/playerShown.ts:55](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/playerShown.ts#L55)

##### slots

> `readonly` **slots**: [`PlainRecord`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/changelog/PlainData/index.md#plainrecord)

Defined in: [packages/prismarine/src/entity/playerShown.ts:55](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/playerShown.ts#L55)

***

### PlayerSlot

> **PlayerSlot** = `object`

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

One slot a player carries, as a slot entry addresses it.

#### Properties

##### container

> `readonly` **container**: [`EntityContainer`](https://jsprismarine.dev/api/@jsprismarine/prismarine/inventory/slotLog/index.md#entitycontainer)

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

##### slot

> `readonly` **slot**: `number`

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

***

### ShownPlayerState

> **ShownPlayerState** = `object`

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

What clients are shown of a store player beside its entity, read back from logged fields.

#### Properties

##### air

> `readonly` **air**: `number`

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

Ticks of breath left.

##### breathing

> `readonly` **breathing**: `boolean`

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

##### flying

> `readonly` **flying**: `boolean`

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

##### gamemode

> `readonly` **gamemode**: [`Gametype`](https://jsprismarine.dev/api/@jsprismarine/minecraft/index.md#gametype)

Defined in: [packages/prismarine/src/entity/playerShown.ts:64](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/playerShown.ts#L64)

##### gliding

> `readonly` **gliding**: `boolean`

Defined in: [packages/prismarine/src/entity/playerShown.ts:63](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/playerShown.ts#L63)

##### handSlot

> `readonly` **handSlot**: `number`

Defined in: [packages/prismarine/src/entity/playerShown.ts:61](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/playerShown.ts#L61)

The hotbar slot the hand points at.

##### headYaw

> `readonly` **headYaw**: `number`

Defined in: [packages/prismarine/src/entity/playerShown.ts:59](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/playerShown.ts#L59)

##### sprinting

> `readonly` **sprinting**: `boolean`

Defined in: [packages/prismarine/src/entity/playerShown.ts:62](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/playerShown.ts#L62)

## Variables

### HAND\_SLOT\_FIELD

> `const` **HAND\_SLOT\_FIELD**: `"inventory.handSlot"` = `'inventory.handSlot'`

Defined in: [packages/prismarine/src/entity/playerShown.ts:23](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/playerShown.ts#L23)

The field the hotbar slot a player's hand points at is logged as.

***

### HEAD\_YAW\_FIELD

> `const` **HEAD\_YAW\_FIELD**: `"look.headYaw"` = `'look.headYaw'`

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

The field a player's head yaw is logged as, which the client reports apart from the body's yaw.

***

### SHOWN\_PLAYER\_COMPONENTS

> `const` **SHOWN\_PLAYER\_COMPONENTS**: readonly \[`"movement.sprinting"`, `"movement.gliding"`, `"abilities.gamemode"`, `"abilities.flying"`, `"vitals.air"`, `"vitals.breathing"`\]

Defined in: [packages/prismarine/src/entity/playerShown.ts:29](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/playerShown.ts#L29)

The component fields clients are shown of a player: sprinting, gliding, whether it may fly,
which its game mode decides, whether it is flying, and its breath.

***

### SHOWN\_PLAYER\_SLOTS

> `const` **SHOWN\_PLAYER\_SLOTS**: readonly [`PlayerSlot`](#playerslot)[]

Defined in: [packages/prismarine/src/entity/playerShown.ts:45](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/playerShown.ts#L45)

The slots a player is seen holding and wearing: the hotbar the hand points into, the armor and the off hand.

## Functions

### shownPlayerStateIn()

> **shownPlayerStateIn**(`field`): [`ShownPlayerState`](#shownplayerstate) \| `undefined`

Defined in: [packages/prismarine/src/entity/playerShown.ts:76](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/playerShown.ts#L76)

A store player's shown state, from its logged fields.

#### Parameters

##### field

(`name`) => [`PlainData`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/changelog/PlainData/index.md#plaindata) \| `undefined`

One logged field by name, or undefined when none is held.

#### Returns

[`ShownPlayerState`](#shownplayerstate) \| `undefined`

The state, or undefined for an entity no store player's shown form started.

***

### slotKey()

> **slotKey**(`container`, `slot`): `string`

Defined in: [packages/prismarine/src/entity/playerShown.ts:42](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/playerShown.ts#L42)

The key of a slot, as the replica holds it: `container:slot`.

#### Parameters

##### container

`string`

##### slot

`number`

#### Returns

`string`
