Skip to content

API reference / @jsprismarine/prismarine / world/ShownActor

world/ShownActor ​

Interfaces ​

ShownActor ​

Defined in: packages/prismarine/src/world/ShownActor.ts:32

One actor as the network layer shows it.

Extended by ​

Properties ​

attributes ​

readonly attributes: Attributes

Defined in: packages/prismarine/src/world/ShownActor.ts:44

The attributes a client is sent.

headYaw ​

readonly headYaw: number

Defined in: packages/prismarine/src/world/ShownActor.ts:39

metadata ​

readonly metadata: Metadata

Defined in: packages/prismarine/src/world/ShownActor.ts:41

The actor metadata a client is sent, flags and properties both.

pitch ​

readonly pitch: number

Defined in: packages/prismarine/src/world/ShownActor.ts:37

yaw ​

readonly yaw: number

Defined in: packages/prismarine/src/world/ShownActor.ts:38

Methods ​

getEquipment() ​

getEquipment(): ViewableEquipment

Defined in: packages/prismarine/src/world/ShownActor.ts:45

Returns ​

ViewableEquipment

getPosition() ​

getPosition(): Vector3

Defined in: packages/prismarine/src/world/ShownActor.ts:35

Returns ​

Vector3

getRuntimeId() ​

getRuntimeId(): bigint

Defined in: packages/prismarine/src/world/ShownActor.ts:33

Returns ​

bigint

getStatusEffects() ​

getStatusEffects(): readonly StatusEffect[]

Defined in: packages/prismarine/src/world/ShownActor.ts:46

Returns ​

readonly StatusEffect[]

getSyncedProperties() ​

getSyncedProperties(): SyncedProperties

Defined in: packages/prismarine/src/world/ShownActor.ts:42

Returns ​

SyncedProperties

getType() ​

getType(): string

Defined in: packages/prismarine/src/world/ShownActor.ts:34

Returns ​

string

getVelocity() ​

getVelocity(): Vector3

Defined in: packages/prismarine/src/world/ShownActor.ts:36

Returns ​

Vector3

isOnGround() ​

isOnGround(): boolean

Defined in: packages/prismarine/src/world/ShownActor.ts:47

Returns ​

boolean


ShownEntity ​

Defined in: packages/prismarine/src/world/ShownActor.ts:106

One entity as tracking reads it: where it is, how far it is followed, and how a client is shown it.

Extends ​

  • TrackableEntity

Methods ​

describe()? ​

optional describe(): ShownEntityFacts | undefined

Defined in: packages/prismarine/src/world/ShownActor.ts:114

The entity as plain facts, or undefined when it cannot be shown yet.

Returns ​

ShownEntityFacts | undefined

getPosition() ​

getPosition(): Point3

Defined in: packages/prismarine/src/player/EntityTracker.ts:12

Returns ​

Point3

Inherited from ​

TrackableEntity.getPosition

getRuntimeId() ​

getRuntimeId(): bigint

Defined in: packages/prismarine/src/player/EntityTracker.ts:11

Returns ​

bigint

Inherited from ​

TrackableEntity.getRuntimeId

getTrackingRange() ​

getTrackingRange(): number

Defined in: packages/prismarine/src/player/EntityTracker.ts:14

How far clients follow this kind of entity, in chunks. See StoreActor.getTrackingRange.

Returns ​

number

Inherited from ​

TrackableEntity.getTrackingRange

riding()? ​

optional riding(): ShownRiding

Defined in: packages/prismarine/src/world/ShownActor.ts:116

What it rides and who rides it, which a client is shown once it is shown the entity.

Returns ​

ShownRiding

spawnTo() ​

spawnTo(session): Promise<void>

Defined in: packages/prismarine/src/world/ShownActor.ts:112

Shows the entity to one client, which for most entities is an AddActorPacket. The packets are queued before it returns, and it throws when they cannot be built; the promise settles once the transport has framed them.

Parameters ​
session ​

PlayerSession

Returns ​

Promise<void>


ShownEntityFacts ​

Defined in: packages/prismarine/src/world/ShownActor.ts:82

One entity as plain facts, for a client whose edition spawnTo does not speak: what it is, where its feet are, where it faces, and a player's profile.

Properties ​

equipment? ​

readonly optional equipment?: Partial<Record<"head" | "chest" | "feet" | "mainhand" | "offhand" | "body" | "legs", ShownStack>>

Defined in: packages/prismarine/src/world/ShownActor.ts:92

What it holds and wears; an entity with none shows none.

experience? ​

readonly optional experience?: number

Defined in: packages/prismarine/src/world/ShownActor.ts:98

The points an experience orb is worth, which its size shows.

facing? ​

readonly optional facing?: "south" | "west" | "north" | "east"

Defined in: packages/prismarine/src/world/ShownActor.ts:102

The way a painting faces out from its wall; an entity that hangs from nothing has none.

feet ​

readonly feet: object

Defined in: packages/prismarine/src/world/ShownActor.ts:85

x ​

readonly x: number

y ​

readonly y: number

z ​

readonly z: number

firework? ​

readonly optional firework?: ShownFirework

Defined in: packages/prismarine/src/world/ShownActor.ts:100

What a firework rocket was and how it flies.

headYaw ​

readonly headYaw: number

Defined in: packages/prismarine/src/world/ShownActor.ts:88

item? ​

readonly optional item?: ShownStack

Defined in: packages/prismarine/src/world/ShownActor.ts:96

The stack a dropped item holds.

pitch ​

readonly pitch: number

Defined in: packages/prismarine/src/world/ShownActor.ts:87

player? ​

readonly optional player?: ShownProfile

Defined in: packages/prismarine/src/world/ShownActor.ts:90

The player's profile, for a player.

state? ​

readonly optional state?: ShownEntityState

Defined in: packages/prismarine/src/world/ShownActor.ts:94

How it carries itself: crouched, burning and the like.

type ​

readonly type: string

Defined in: packages/prismarine/src/world/ShownActor.ts:84

The entity type clients are shown, as Bedrock names it.

yaw ​

readonly yaw: number

Defined in: packages/prismarine/src/world/ShownActor.ts:86


ShownFirework ​

Defined in: packages/prismarine/src/world/ShownActor.ts:69

A firework rocket as a client is shown it: the stack it was, and how it flies.

Properties ​

attachedTo? ​

readonly optional attachedTo?: bigint

Defined in: packages/prismarine/src/world/ShownActor.ts:73

The entity it rides along with, which its client boosts when it is its own player.

item ​

readonly item: ShownStack

Defined in: packages/prismarine/src/world/ShownActor.ts:71

The rocket stack, whose explosions the client draws its burst from.

shotAtAngle ​

readonly shotAtAngle: boolean

Defined in: packages/prismarine/src/world/ShownActor.ts:75

Whether it flies straight, as one a crossbow fires does.


ShownProfile ​

Defined in: packages/prismarine/src/world/ShownActor.ts:51

A player's profile, as a Java client lists it.

Properties ​

gamemode? ​

readonly optional gamemode?: Gametype

Defined in: packages/prismarine/src/world/ShownActor.ts:60

The player's game mode, which a Java client's tab list shows.

name ​

readonly name: string

Defined in: packages/prismarine/src/world/ShownActor.ts:53

skinParts? ​

readonly optional skinParts?: number

Defined in: packages/prismarine/src/world/ShownActor.ts:65

The parts of its skin a Java player shows, as its client's settings name them, the cape first. A player of another edition, which has no such setting, shows them all.

textures? ​

readonly optional textures?: object

Defined in: packages/prismarine/src/world/ShownActor.ts:58

The textures property Mojang's session server signed, for a Java player who logged in online: a Java client draws the player's skin and cape from it.

signature ​

readonly signature: string | null

value ​

readonly value: string

uuid ​

readonly uuid: string

Defined in: packages/prismarine/src/world/ShownActor.ts:52


ShownRiding ​

Defined in: packages/prismarine/src/world/ShownActor.ts:120

One entity's place in a stack of riders.

Properties ​

riders ​

readonly riders: readonly bigint[]

Defined in: packages/prismarine/src/world/ShownActor.ts:126

Who rides it, in the order they got on.

vehicle? ​

readonly optional vehicle?: bigint

Defined in: packages/prismarine/src/world/ShownActor.ts:122

What it rides, when it rides anything.

vehicleRiders? ​

readonly optional vehicleRiders?: readonly bigint[]

Defined in: packages/prismarine/src/world/ShownActor.ts:124

Everyone riding that vehicle, itself among them, in the order they got on.

Variables ​

ACTOR_TRACKING_RANGE_CHUNKS ​

const ACTOR_TRACKING_RANGE_CHUNKS: 8 = 8

Defined in: packages/prismarine/src/world/ShownActor.ts:29

How far clients follow an entity of a type Java does not have, such as one of Bedrock's own, in chunks. A type Java has is followed as far as Java's EntityType.clientTrackingRange says.

Java See ​

EntityType.clientTrackingRange()I

Functions ​

ridersShownTo() ​

ridersShownTo(viewer, riders): readonly bigint[]

Defined in: packages/prismarine/src/world/ShownActor.ts:130

The riders of a vehicle one client is shown: those it tracks, and its own player.

Parameters ​

viewer ​
runtimeId ​

bigint

tracks ​

(runtimeId) => boolean

riders ​

readonly bigint[]

Returns ​

readonly bigint[]