Skip to content

API reference / @jsprismarine/prismarine / entity/data/actorView

entity/data/actorView ​

Interfaces ​

ShownHealth ​

Defined in: packages/prismarine/src/entity/data/actorView.ts:37

The health a client is shown: the current value and the most it can be.

Properties ​

current ​

readonly current: number

Defined in: packages/prismarine/src/entity/data/actorView.ts:38

max ​

readonly max: number

Defined in: packages/prismarine/src/entity/data/actorView.ts:39


ShownPose ​

Defined in: packages/prismarine/src/entity/data/actorView.ts:26

Where an entity stands and faces, which a move is measured from.

Properties ​

headYaw ​

readonly headYaw: number

Defined in: packages/prismarine/src/entity/data/actorView.ts:32

Where the head faces, which a look turns apart from the body.

pitch ​

readonly pitch: number

Defined in: packages/prismarine/src/entity/data/actorView.ts:33

x ​

readonly x: number

Defined in: packages/prismarine/src/entity/data/actorView.ts:27

y ​

readonly y: number

Defined in: packages/prismarine/src/entity/data/actorView.ts:28

yaw ​

readonly yaw: number

Defined in: packages/prismarine/src/entity/data/actorView.ts:30

z ​

readonly z: number

Defined in: packages/prismarine/src/entity/data/actorView.ts:29

Type Aliases ​

EntityView ​

EntityView = object

Defined in: packages/prismarine/src/entity/data/actorView.ts:73

Everything a client is shown of one store entity that its store fields decide: where it is, its metadata, its health, its synced properties and its status effects.

What it holds and wears is in its slots, which the replica reads apart (EntityReplica.equipment). What a player's own components add (breath, sprinting, flight) and what a session holds of a player (its skin and its name) are not part of it.

Properties ​

health ​

readonly health: ShownHealth | undefined

Defined in: packages/prismarine/src/entity/data/actorView.ts:79

identifier ​

readonly identifier: string

Defined in: packages/prismarine/src/entity/data/actorView.ts:74

metadata ​

readonly metadata: ActorMetadataProjection

Defined in: packages/prismarine/src/entity/data/actorView.ts:78

onGround ​

readonly onGround: boolean

Defined in: packages/prismarine/src/entity/data/actorView.ts:77

pose ​

readonly pose: ShownPose

Defined in: packages/prismarine/src/entity/data/actorView.ts:75

properties ​

readonly properties: SyncedProperties

Defined in: packages/prismarine/src/entity/data/actorView.ts:80

statusEffects ​

readonly statusEffects: readonly StatusEffect[]

Defined in: packages/prismarine/src/entity/data/actorView.ts:81

velocity ​

readonly velocity: EntityPosition

Defined in: packages/prismarine/src/entity/data/actorView.ts:76

villager? ​

readonly optional villager?: VillagerView

Defined in: packages/prismarine/src/entity/data/actorView.ts:83

What a villager's outfit and badge are drawn from, or undefined for any other entity.

Functions ​

entityViewOf() ​

entityViewOf(entity, leashHolderId?): EntityView

Defined in: packages/prismarine/src/entity/data/actorView.ts:90

The view of a live store entity.

Parameters ​

entity ​

DataEntity

leashHolderId? ​

number

Runtime id of the entity holding its leash, when one is loaded.

Returns ​

EntityView


healthAttributesOf() ​

healthAttributesOf(health): Attributes

Defined in: packages/prismarine/src/entity/data/actorView.ts:50

The attributes a client is sent for an entity with the given health.

The type's maximum rather than Attributes.getDefaults' twenty, so a client draws a ten-health cow with five hearts instead of with two and a half. A type with no health is sent none, so an armor stand is not drawn as a living thing.

Parameters ​

health ​

ShownHealth | undefined

The entity's health, or undefined for a type with none.

Returns ​

Attributes


villagerFieldOf() ​

villagerFieldOf(villager): object

Defined in: packages/prismarine/src/entity/data/actorView.ts:22

A view's villager field, left out for an entity that is no villager.

Parameters ​

villager ​

VillagerView | undefined

Returns ​

object

villager? ​

readonly optional villager?: VillagerView