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
readonlyattributes:Attributes
Defined in: packages/prismarine/src/world/ShownActor.ts:44
The attributes a client is sent.
headYaw
readonlyheadYaw:number
Defined in: packages/prismarine/src/world/ShownActor.ts:39
metadata
readonlymetadata:Metadata
Defined in: packages/prismarine/src/world/ShownActor.ts:41
The actor metadata a client is sent, flags and properties both.
pitch
readonlypitch:number
Defined in: packages/prismarine/src/world/ShownActor.ts:37
yaw
readonlyyaw:number
Defined in: packages/prismarine/src/world/ShownActor.ts:38
Methods
getEquipment()
getEquipment():
ViewableEquipment
Defined in: packages/prismarine/src/world/ShownActor.ts:45
Returns
getPosition()
getPosition():
Vector3
Defined in: packages/prismarine/src/world/ShownActor.ts:35
Returns
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
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
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()?
optionaldescribe():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
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()?
optionalriding():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
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
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?
readonlyoptionalequipment?: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?
readonlyoptionalexperience?:number
Defined in: packages/prismarine/src/world/ShownActor.ts:98
The points an experience orb is worth, which its size shows.
facing?
readonlyoptionalfacing?:"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
readonlyfeet:object
Defined in: packages/prismarine/src/world/ShownActor.ts:85
x
readonlyx:number
y
readonlyy:number
z
readonlyz:number
firework?
readonlyoptionalfirework?:ShownFirework
Defined in: packages/prismarine/src/world/ShownActor.ts:100
What a firework rocket was and how it flies.
headYaw
readonlyheadYaw:number
Defined in: packages/prismarine/src/world/ShownActor.ts:88
item?
readonlyoptionalitem?:ShownStack
Defined in: packages/prismarine/src/world/ShownActor.ts:96
The stack a dropped item holds.
pitch
readonlypitch:number
Defined in: packages/prismarine/src/world/ShownActor.ts:87
player?
readonlyoptionalplayer?:ShownProfile
Defined in: packages/prismarine/src/world/ShownActor.ts:90
The player's profile, for a player.
state?
readonlyoptionalstate?:ShownEntityState
Defined in: packages/prismarine/src/world/ShownActor.ts:94
How it carries itself: crouched, burning and the like.
type
readonlytype:string
Defined in: packages/prismarine/src/world/ShownActor.ts:84
The entity type clients are shown, as Bedrock names it.
yaw
readonlyyaw: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?
readonlyoptionalattachedTo?: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
readonlyitem:ShownStack
Defined in: packages/prismarine/src/world/ShownActor.ts:71
The rocket stack, whose explosions the client draws its burst from.
shotAtAngle
readonlyshotAtAngle: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?
readonlyoptionalgamemode?:Gametype
Defined in: packages/prismarine/src/world/ShownActor.ts:60
The player's game mode, which a Java client's tab list shows.
name
readonlyname:string
Defined in: packages/prismarine/src/world/ShownActor.ts:53
skinParts?
readonlyoptionalskinParts?: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?
readonlyoptionaltextures?: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
readonlysignature:string|null
value
readonlyvalue:string
uuid
readonlyuuid: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
readonlyriders: readonlybigint[]
Defined in: packages/prismarine/src/world/ShownActor.ts:126
Who rides it, in the order they got on.
vehicle?
readonlyoptionalvehicle?:bigint
Defined in: packages/prismarine/src/world/ShownActor.ts:122
What it rides, when it rides anything.
vehicleRiders?
readonlyoptionalvehicleRiders?: readonlybigint[]
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
constACTOR_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): readonlybigint[]
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[]