API reference / @jsprismarine/prismarine / entity/data/storePlayers / StorePlayerActor
Class: StorePlayerActor
Defined in: packages/prismarine/src/entity/data/storePlayers.ts:207
One store player as the network layer and the world code read it.
The position, the look and the status effects come from the store, as a mob's do, and the identity, the head yaw, the game mode, flight and equipment from the StorePlayer. Where a player and a mob differ in how they are shown, this follows what a client expects of a player.
Extends
Implements
Constructors
Constructor
new StorePlayerActor(
player,entity,world,blows):StorePlayerActor
Defined in: packages/prismarine/src/entity/data/storePlayers.ts:222
Parameters
player
The store player behind the actor.
entity
The player's entity in this actor's store.
world
blows
Returns
StorePlayerActor
Overrides
Properties
entity
readonlyentity:DataEntity
Defined in: packages/prismarine/src/entity/data/storeActors.ts:103
The store entity behind the actor.
Inherited from
player
readonlyplayer:StorePlayer
Defined in: packages/prismarine/src/entity/data/storePlayers.ts:223
The store player behind the actor.
Accessors
attributes
Get Signature
get attributes():
Attributes
Defined in: packages/prismarine/src/entity/data/storePlayers.ts:212
None: other clients were never sent a legacy player's attributes, and its own client is sent them by its session.
Returns
Attributes
The attributes a client is sent.
Implementation of
Overrides
device
Get Signature
get device():
Device|null
Defined in: packages/prismarine/src/entity/data/storePlayers.ts:340
The device the client logged in from, or null when it said nothing.
Returns
Device | null
The device the client logged in from, or null when it said nothing.
Implementation of
gamemode
Get Signature
get gamemode():
Gametype
Defined in: packages/prismarine/src/entity/data/storePlayers.ts:348
Returns
Implementation of
headYaw
Get Signature
get headYaw():
number
Defined in: packages/prismarine/src/entity/data/storePlayers.ts:313
The head turns apart from the body, as the client reports it.
Returns
number
Implementation of
Overrides
metadata
Get Signature
get metadata():
Metadata
Defined in: packages/prismarine/src/entity/data/storePlayers.ts:237
The projection of the entity's components, then what the player's components decide about its metadata, which the projection knows nothing of: air and breathing, which the breath system keeps, sprinting, gliding, and whether it may fly, which its game mode decides, as a legacy player writes them into its own metadata.
Returns
The actor metadata a client is sent, flags and properties both.
Implementation of
Overrides
persistentNbt
Get Signature
get persistentNbt():
NBTTagCompound|null
Defined in: packages/prismarine/src/entity/data/storeActors.ts:141
The actor record tags this server does not model, which the next save writes back, such as the actor's UniqueID. A save writes the entity's record into them first.
They are kept in the store, as network NBT bytes in a logged field, so this answers a new compound on every read: change one by assigning it back.
Returns
NBTTagCompound | null
Set Signature
set persistentNbt(
tags):void
Defined in: packages/prismarine/src/entity/data/storeActors.ts:146
Parameters
tags
NBTTagCompound | null
Returns
void
Inherited from
pitch
Get Signature
get pitch():
number
Defined in: packages/prismarine/src/entity/data/storeActors.ts:186
Returns
number
Implementation of
Inherited from
platformChatId
Get Signature
get platformChatId():
string
Defined in: packages/prismarine/src/entity/data/storePlayers.ts:336
Returns
string
Implementation of
skin
Get Signature
get skin():
Skin|null
Defined in: packages/prismarine/src/entity/data/storePlayers.ts:344
Returns
Skin | null
Implementation of
xuid
Get Signature
get xuid():
string
Defined in: packages/prismarine/src/entity/data/storePlayers.ts:332
Returns
string
Implementation of
yaw
Get Signature
get yaw():
number
Defined in: packages/prismarine/src/entity/data/storeActors.ts:190
Returns
number
Implementation of
Inherited from
Methods
addStatusEffect()
addStatusEffect(
input,notify?):boolean
Defined in: packages/prismarine/src/entity/data/storeActors.ts:353
Applies or refreshes a status effect in the store, unless the entity's minecraft:mob_effect_immunity refuses it, merging with an effect already running.
Parameters
input
notify?
boolean = true
Whether to tell clients about an accepted change.
Returns
boolean
Whether the effect changed.
Inherited from
addTag()
addTag(
tag):boolean
Defined in: packages/prismarine/src/entity/data/storeActors.ts:325
Adds a /tag tag.
Parameters
tag
string
Returns
boolean
Whether the entity did not already carry it.
Inherited from
applyImpulse()
applyImpulse(
impulse):void
Defined in: packages/prismarine/src/entity/data/storeActors.ts:303
Adds an impulse to the entity body the runtime integrates each tick.
Parameters
impulse
Returns
void
Inherited from
applyKnockback()
applyKnockback(
directionX,directionZ,strength,damping?):void
Defined in: packages/prismarine/src/entity/data/storeActors.ts:312
Shoves the entity: vanilla's rule is that each shove halves whatever motion the last one left before adding its own, which is what makes a sprint hit both throw harder and cancel more of the run the target was making.
Parameters
directionX
number
directionZ
number
strength
number
damping?
number = 0.5
Returns
void
Inherited from
claimUpdate()
claimUpdate(
tick):boolean
Defined in: packages/prismarine/src/entity/data/storePlayers.ts:249
Claims the player's one update of a tick, which an actor in another world shares.
Parameters
tick
number
Returns
boolean
Overrides
clearStatusEffects()
clearStatusEffects(
notify?):number
Defined in: packages/prismarine/src/entity/data/storeActors.ts:389
Removes every active status effect.
Parameters
notify?
boolean = true
Returns
number
How many were cleared.
Inherited from
damage()
damage(
amount,source?):Promise<boolean>
Defined in: packages/prismarine/src/entity/data/storeActors.ts:281
Hands a blow to the store's damage pipeline, which decides it and applies it before this returns.
Parameters
amount
number
source?
DamageCause | DamageSource = DamageCause.Generic
Returns
Promise<boolean>
Inherited from
getBox()
getBox():
EntityBox
Defined in: packages/prismarine/src/entity/data/storeActors.ts:233
How big the entity is, from its type's collision box.
Returns
Inherited from
getCommandLevel()
getCommandLevel():
CommandPermissionLevel
Defined in: packages/prismarine/src/entity/data/storePlayers.ts:358
The command level the player runs at, which sets the command permission other clients see.
Returns
Implementation of
getDefaultPortalCooldown()
getDefaultPortalCooldown():
number
Defined in: packages/prismarine/src/entity/data/storePlayers.ts:284
Half a second, where a mob waits fifteen: Player.getDimensionChangingDelay in vanilla.
Returns
number
Overrides
StoreActor.getDefaultPortalCooldown
getEquipment()
getEquipment():
ViewableEquipment
Defined in: packages/prismarine/src/entity/data/storePlayers.ts:318
What the player holds and wears, from its inventory.
Returns
Implementation of
Overrides
getFeetY()
getFeetY():
number
Defined in: packages/prismarine/src/entity/data/storeActors.ts:228
Where the bottom of the body is, which for a store entity is its position.
Returns
number
Inherited from
getHealth()
getHealth():
number
Defined in: packages/prismarine/src/entity/data/storeActors.ts:248
The entity's health in the store, or zero for a type with no health.
Returns
number
Inherited from
getMaxHealth()
getMaxHealth():
number
Defined in: packages/prismarine/src/entity/data/storeActors.ts:253
The entity's maximum health in the store, or zero for a type with no health.
Returns
number
Inherited from
getName()
getName():
string
Defined in: packages/prismarine/src/entity/data/storePlayers.ts:328
The name the login carried.
Returns
string
Implementation of
Overrides
getPortalCooldown()
getPortalCooldown():
number
Defined in: packages/prismarine/src/entity/data/storePlayers.ts:289
The player's cooldown, which it keeps from one store to the next and in its record.
Returns
number
Overrides
getPortalTransitionTicks()
getPortalTransitionTicks(
rule?):number
Defined in: packages/prismarine/src/entity/data/storePlayers.ts:277
Ticks this player has to stand in a portal before going through.
Vanilla reads players_nether_portal_creative_delay (0) for a creative player and players_nether_portal_default_delay (80) for everyone else; the game rules are not modeled yet, so the portal rule's defaults are the answer. An end portal's rule says 0 for both.
Parameters
rule?
The rule of the portal stood in. Without one, a nether portal is assumed.
Returns
number
Overrides
StoreActor.getPortalTransitionTicks
getPosition()
getPosition():
Vector3
Defined in: packages/prismarine/src/entity/data/storePlayers.ts:308
Where the player's eyes are, which is where a client draws a player and where a legacy player is.
Returns
Implementation of
Overrides
getRuntimeId()
getRuntimeId():
bigint
Defined in: packages/prismarine/src/entity/data/storeActors.ts:166
Returns
bigint
Inherit Doc
Implementation of
Inherited from
getServer()
getServer():
Server
Defined in: packages/prismarine/src/entity/data/storeActors.ts:161
The server the world belongs to.
Returns
Inherited from
getStatusEffect()
getStatusEffect(
identifier):StatusEffect|undefined
Defined in: packages/prismarine/src/entity/data/storeActors.ts:337
One active effect by its namespaced id or bare Bedrock name.
Parameters
identifier
string
Returns
StatusEffect | undefined
Inherited from
getStatusEffects()
getStatusEffects(): readonly
StatusEffect[]
Defined in: packages/prismarine/src/entity/data/storeActors.ts:218
Returns
readonly StatusEffect[]
Inherit Doc
Implementation of
Inherited from
getSyncedProperties()
getSyncedProperties():
SyncedProperties
Defined in: packages/prismarine/src/entity/data/storeActors.ts:208
Returns
Inherit Doc
Implementation of
ShownPlayer.getSyncedProperties
Inherited from
StoreActor.getSyncedProperties
getTags()
getTags(): readonly
string[]
Defined in: packages/prismarine/src/entity/data/storeActors.ts:320
The /tag tags of the entity.
Returns
readonly string[]
Inherited from
getType()
getType():
string
Defined in: packages/prismarine/src/entity/data/storeActors.ts:171
Returns
string
Inherit Doc
Implementation of
Inherited from
getUUID()
getUUID():
UUIDValue
Defined in: packages/prismarine/src/entity/data/storePlayers.ts:323
The identity the client logged in with.
Returns
Implementation of
getVelocity()
getVelocity():
Vector3
Defined in: packages/prismarine/src/entity/data/storeActors.ts:182
Returns
Inherit Doc
Implementation of
Inherited from
getWorld()
getWorld():
World
Defined in: packages/prismarine/src/entity/data/storeActors.ts:156
The world the entity stands in.
Returns
Inherited from
hasStatusEffect()
hasStatusEffect(
identifier):boolean
Defined in: packages/prismarine/src/entity/data/storeActors.ts:342
Whether one status effect is active.
Parameters
identifier
string
Returns
boolean
Inherited from
heal()
heal(
amount):Promise<boolean>
Defined in: packages/prismarine/src/entity/data/storeActors.ts:298
Heals the entity in the store.
Parameters
amount
number
Returns
Promise<boolean>
Inherited from
isAlive()
isAlive():
boolean
Defined in: packages/prismarine/src/entity/data/storeActors.ts:258
Whether the entity is still in the store and has health left.
Returns
boolean
Inherited from
isAttackable()
isAttackable():
boolean
Defined in: packages/prismarine/src/entity/data/storeActors.ts:266
Whether a blow can land on the entity: one with health left, or a boat or minecart, which has none and breaks from the damage blows add up to, as Java's VehicleEntity does.
Returns
boolean
Inherited from
isFlying()
isFlying():
boolean
Defined in: packages/prismarine/src/entity/data/storePlayers.ts:363
Returns
boolean
Inherit Doc
Implementation of
isOnGround()
isOnGround():
boolean
Defined in: packages/prismarine/src/entity/data/storeActors.ts:223
Returns
boolean
Inherit Doc
Implementation of
Inherited from
isOnPortalCooldown()
isOnPortalCooldown():
boolean
Defined in: packages/prismarine/src/entity/data/storeActors.ts:431
Whether the entity still refuses portals after a recent dimension change.
Returns
boolean
Inherited from
isOp()
isOp():
boolean
Defined in: packages/prismarine/src/entity/data/storePlayers.ts:353
Whether the permission service lists the player as an operator.
Returns
boolean
Implementation of
portalContact()
portalContact():
PortalContact|undefined
Defined in: packages/prismarine/src/entity/data/storeActors.ts:444
The portal the entity is in contact with, if any.
Returns
PortalContact | undefined
Inherited from
projectMetadata()
projectMetadata(
leashHolderId?):ActorMetadataProjection
Defined in: packages/prismarine/src/entity/data/storeActors.ts:203
The actor metadata the store state projects to, which StoreActor.metadata writes.
Parameters
leashHolderId?
number
The runtime id of whatever holds the entity's leash.
Returns
Inherited from
removeStatusEffect()
removeStatusEffect(
identifier,notify?):boolean
Defined in: packages/prismarine/src/entity/data/storeActors.ts:380
Removes one status effect.
Parameters
identifier
string
notify?
boolean = true
Returns
boolean
Whether an active effect was removed.
Inherited from
removeTag()
removeTag(
tag):boolean
Defined in: packages/prismarine/src/entity/data/storeActors.ts:332
Takes a /tag tag off.
Parameters
tag
string
Returns
boolean
Whether the entity carried it.
Inherited from
setHealth()
setHealth(
health,source?):Promise<void>
Defined in: packages/prismarine/src/entity/data/storeActors.ts:290
A health written onto the entity: a lower one, which is what /kill writes, is a blow for the difference through the store's pipeline, and a higher one is a heal.
Parameters
health
number
source?
DamageCause | DamageSource = DamageCause.Generic
Returns
Promise<void>
Inherited from
setName()
setName(
name):void
Defined in: packages/prismarine/src/entity/data/storeActors.ts:243
Names the entity in the store, which shows it to clients.
Parameters
name
string
Returns
void
Inherited from
setPortalCooldown()
setPortalCooldown(
ticks?):void
Defined in: packages/prismarine/src/entity/data/storePlayers.ts:294
Starts the portal cooldown, on arrival through a portal.
Parameters
ticks?
number = ...
Returns
void
Overrides
shouldPersist()
shouldPersist():
boolean
Defined in: packages/prismarine/src/entity/data/storeActors.ts:273
Whether a save writes the entity, which Bedrock's minecraft:transient turns off.
Returns
boolean
Inherited from
toString()
toString():
string
Defined in: packages/prismarine/src/entity/data/storeActors.ts:151
The entity as /debug lists it.
Returns
string
Inherited from
touchPortal()
touchPortal(
at,portal?):void
Defined in: packages/prismarine/src/entity/data/storeActors.ts:452
Records that the entity overlaps a portal block this tick: a touch on cooldown winds the cooldown back instead of opening a contact.
Parameters
at
portal?
Returns
void
Inherited from
update()
update(
tick):void
Defined in: packages/prismarine/src/entity/data/storePlayers.ts:257
The entity's part of the tick, then the player's own: its session, its attribute sync and its triggers, which run for the player the session speaks for.
Parameters
tick
number
Returns
void