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
readonlyfields:PlainRecord
Defined in: packages/prismarine/src/entity/playerShown.ts:55
slots
readonlyslots: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
readonlycontainer:EntityContainer
Defined in: packages/prismarine/src/entity/playerShown.ts:39
slot
readonlyslot: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
readonlyair:number
Defined in: packages/prismarine/src/entity/playerShown.ts:67
Ticks of breath left.
breathing
readonlybreathing:boolean
Defined in: packages/prismarine/src/entity/playerShown.ts:68
flying
readonlyflying:boolean
Defined in: packages/prismarine/src/entity/playerShown.ts:65
gamemode
readonlygamemode:Gametype
Defined in: packages/prismarine/src/entity/playerShown.ts:64
gliding
readonlygliding:boolean
Defined in: packages/prismarine/src/entity/playerShown.ts:63
handSlot
readonlyhandSlot:number
Defined in: packages/prismarine/src/entity/playerShown.ts:61
The hotbar slot the hand points at.
headYaw
readonlyheadYaw:number
Defined in: packages/prismarine/src/entity/playerShown.ts:59
sprinting
readonlysprinting:boolean
Defined in: packages/prismarine/src/entity/playerShown.ts:62
Variables
HAND_SLOT_FIELD
constHAND_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
constHEAD_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
constSHOWN_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
constSHOWN_PLAYER_SLOTS: readonlyPlayerSlot[]
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