Skip to content

API reference / @jsprismarine/prismarine / editions/bedrock/decoder/DecodeView

editions/bedrock/decoder/DecodeView ​

Interfaces ​

DecodeView ​

Defined in: packages/prismarine/src/editions/bedrock/decoder/DecodeView.ts:43

The view and where a decoder says why it dropped a packet.

Extends ​

Properties ​

gamemode ​

readonly gamemode: Gametype

Defined in: packages/prismarine/src/editions/bedrock/decoder/DecodeView.ts:21

The sender's game mode.

Inherited from ​

SessionView.gamemode

log ​

readonly log: HandlerLog

Defined in: packages/prismarine/src/editions/bedrock/decoder/DecodeView.ts:45

Where a dropped packet is explained, at debug level.

name ​

readonly name: string

Defined in: packages/prismarine/src/editions/bedrock/decoder/DecodeView.ts:19

The sender's display name, for log lines.

Inherited from ​

SessionView.name

runtimeId ​

readonly runtimeId: bigint

Defined in: packages/prismarine/src/editions/bedrock/decoder/DecodeView.ts:17

The sender's runtime id, which a client names when it means itself.

Inherited from ​

SessionView.runtimeId

serverTimedBreaking ​

readonly serverTimedBreaking: boolean

Defined in: packages/prismarine/src/editions/bedrock/decoder/DecodeView.ts:26

Whether the server times the sender's block breaks, as server-authoritative-block-breaking sets it, rather than taking the client's word that a block broke.

Inherited from ​

SessionView.serverTimedBreaking

Methods ​

bossBarShownFor() ​

bossBarShownFor(actor): number | undefined

Defined in: packages/prismarine/src/editions/bedrock/decoder/DecodeView.ts:39

The boss bar the sender has on screen bound to an actor, which may be a client-only one.

Parameters ​
actor ​

bigint

The actor's unique id, as the client named it.

Returns ​

number | undefined

The bar's id, or undefined when no bar is bound to the actor.

Inherited from ​

SessionView.bossBarShownFor

tracks() ​

tracks(runtimeId): boolean

Defined in: packages/prismarine/src/editions/bedrock/decoder/DecodeView.ts:32

Whether the sender has been shown the actor with runtimeId, so a packet may name it.

Parameters ​
runtimeId ​

bigint

An actor's runtime id.

Returns ​

boolean

Inherited from ​

SessionView.tracks


SessionView ​

Defined in: packages/prismarine/src/editions/bedrock/decoder/DecodeView.ts:15

The session state a decoder reads.

Extended by ​

Properties ​

gamemode ​

readonly gamemode: Gametype

Defined in: packages/prismarine/src/editions/bedrock/decoder/DecodeView.ts:21

The sender's game mode.

name ​

readonly name: string

Defined in: packages/prismarine/src/editions/bedrock/decoder/DecodeView.ts:19

The sender's display name, for log lines.

runtimeId ​

readonly runtimeId: bigint

Defined in: packages/prismarine/src/editions/bedrock/decoder/DecodeView.ts:17

The sender's runtime id, which a client names when it means itself.

serverTimedBreaking ​

readonly serverTimedBreaking: boolean

Defined in: packages/prismarine/src/editions/bedrock/decoder/DecodeView.ts:26

Whether the server times the sender's block breaks, as server-authoritative-block-breaking sets it, rather than taking the client's word that a block broke.

Methods ​

bossBarShownFor() ​

bossBarShownFor(actor): number | undefined

Defined in: packages/prismarine/src/editions/bedrock/decoder/DecodeView.ts:39

The boss bar the sender has on screen bound to an actor, which may be a client-only one.

Parameters ​
actor ​

bigint

The actor's unique id, as the client named it.

Returns ​

number | undefined

The bar's id, or undefined when no bar is bound to the actor.

tracks() ​

tracks(runtimeId): boolean

Defined in: packages/prismarine/src/editions/bedrock/decoder/DecodeView.ts:32

Whether the sender has been shown the actor with runtimeId, so a packet may name it.

Parameters ​
runtimeId ​

bigint

An actor's runtime id.

Returns ​

boolean

Functions ​

viewOf() ​

viewOf(context): DecodeView

Defined in: packages/prismarine/src/editions/bedrock/decoder/DecodeView.ts:55

The view of a live session. Each member reads the session when the decoder asks, so a session whose player is still being built fails only a decoder that reads the player.

Parameters ​

context ​

SessionContext

The session the packet arrived on, where the decoder logs, and the settings the view reads.

Returns ​

DecodeView