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
readonlycurrent:number
Defined in: packages/prismarine/src/entity/data/actorView.ts:38
max
readonlymax: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
readonlyheadYaw:number
Defined in: packages/prismarine/src/entity/data/actorView.ts:32
Where the head faces, which a look turns apart from the body.
pitch
readonlypitch:number
Defined in: packages/prismarine/src/entity/data/actorView.ts:33
x
readonlyx:number
Defined in: packages/prismarine/src/entity/data/actorView.ts:27
y
readonlyy:number
Defined in: packages/prismarine/src/entity/data/actorView.ts:28
yaw
readonlyyaw:number
Defined in: packages/prismarine/src/entity/data/actorView.ts:30
z
readonlyz: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
readonlyhealth:ShownHealth|undefined
Defined in: packages/prismarine/src/entity/data/actorView.ts:79
identifier
readonlyidentifier:string
Defined in: packages/prismarine/src/entity/data/actorView.ts:74
metadata
readonlymetadata:ActorMetadataProjection
Defined in: packages/prismarine/src/entity/data/actorView.ts:78
onGround
readonlyonGround:boolean
Defined in: packages/prismarine/src/entity/data/actorView.ts:77
pose
readonlypose:ShownPose
Defined in: packages/prismarine/src/entity/data/actorView.ts:75
properties
readonlyproperties:SyncedProperties
Defined in: packages/prismarine/src/entity/data/actorView.ts:80
statusEffects
readonlystatusEffects: readonlyStatusEffect[]
Defined in: packages/prismarine/src/entity/data/actorView.ts:81
velocity
readonlyvelocity:EntityPosition
Defined in: packages/prismarine/src/entity/data/actorView.ts:76
villager?
readonlyoptionalvillager?: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
leashHolderId?
number
Runtime id of the entity holding its leash, when one is loaded.
Returns
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?
readonlyoptionalvillager?:VillagerView