Skip to content

API reference / @jsprismarine/prismarine / entity/playerShown

entity/playerShown ​

Type Aliases ​

PlayerShownForm ​

PlayerShownForm = object

Defined in: packages/prismarine/src/entity/playerShown.ts:55

A player's shown form: each shown field by the name its entries carry, and each shown slot by its slotKey.

Properties ​

fields ​

readonly fields: PlainRecord

Defined in: packages/prismarine/src/entity/playerShown.ts:55

slots ​

readonly slots: PlainRecord

Defined in: packages/prismarine/src/entity/playerShown.ts:55


PlayerSlot ​

PlayerSlot = object

Defined in: packages/prismarine/src/entity/playerShown.ts:39

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

Properties ​

container ​

readonly container: EntityContainer

Defined in: packages/prismarine/src/entity/playerShown.ts:39

slot ​

readonly slot: number

Defined in: packages/prismarine/src/entity/playerShown.ts:39


ShownPlayerState ​

ShownPlayerState = object

Defined in: packages/prismarine/src/entity/playerShown.ts:58

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

Ticks of breath left.

breathing ​

readonly breathing: boolean

Defined in: packages/prismarine/src/entity/playerShown.ts:68

flying ​

readonly flying: boolean

Defined in: packages/prismarine/src/entity/playerShown.ts:65

gamemode ​

readonly gamemode: Gametype

Defined in: packages/prismarine/src/entity/playerShown.ts:64

gliding ​

readonly gliding: boolean

Defined in: packages/prismarine/src/entity/playerShown.ts:63

handSlot ​

readonly handSlot: number

Defined in: packages/prismarine/src/entity/playerShown.ts:61

The hotbar slot the hand points at.

headYaw ​

readonly headYaw: number

Defined in: packages/prismarine/src/entity/playerShown.ts:59

sprinting ​

readonly sprinting: boolean

Defined in: packages/prismarine/src/entity/playerShown.ts:62

Variables ​

HAND_SLOT_FIELD ​

const HAND_SLOT_FIELD: "inventory.handSlot" = 'inventory.handSlot'

Defined in: packages/prismarine/src/entity/playerShown.ts:23

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

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

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[]

Defined in: packages/prismarine/src/entity/playerShown.ts:45

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 | undefined

Defined in: packages/prismarine/src/entity/playerShown.ts:76

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

Parameters ​

field ​

(name) => PlainData | undefined

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

Returns ​

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

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

Parameters ​

container ​

string

slot ​

number

Returns ​

string