API reference / @jsprismarine/prismarine / network/replica/EntityReplication
network/replica/EntityReplication
Classes
Interfaces
EntityReplicationPorts
Defined in: packages/prismarine/src/network/replica/EntityReplication.ts:193
What entity replication needs of its world and server.
Methods
compressionLevel()
compressionLevel():
number
Defined in: packages/prismarine/src/network/replica/EntityReplication.ts:203
The configured compression level for shared batches.
Returns
number
content()
content():
ServerContent
Defined in: packages/prismarine/src/network/replica/EntityReplication.ts:201
The content now, which decides the items and the boxes.
Returns
identityOf()
identityOf(
runtimeId):SightIdentity|undefined
Defined in: packages/prismarine/src/network/replica/EntityReplication.ts:199
Who a player is, from the session that speaks for it.
Parameters
runtimeId
bigint
Returns
SightIdentity | undefined
presentToTracked()
presentToTracked(
runtimeId,present):Promise<void>
Defined in: packages/prismarine/src/network/replica/EntityReplication.ts:208
Shows a change through the presenter of every client of another edition that tracks an entity, but its own; sendToTracked reaches the Bedrock ones.
Parameters
runtimeId
bigint
present
(presenter) => Promise<void>
Returns
Promise<void>
queueMove()
queueMove(
packet):void
Defined in: packages/prismarine/src/network/replica/EntityReplication.ts:215
Queues a move for the tick's movement flush.
Parameters
packet
Returns
void
sendToTracked()
sendToTracked(
runtimeId,packetsForCodec):Promise<void>
Defined in: packages/prismarine/src/network/replica/EntityReplication.ts:210
Sends packets built for each codec to every Bedrock client that tracks an entity, but its own.
Parameters
runtimeId
bigint
packetsForCodec
(codec) => readonly NetworkPacket<unknown>[]
Returns
Promise<void>
viewerOf()
viewerOf(
runtimeId):PlayerSession|undefined
Defined in: packages/prismarine/src/network/replica/EntityReplication.ts:197
The session of the player an entity is, if it is one.
Parameters
runtimeId
bigint
Returns
PlayerSession | undefined
viewers()
viewers(): readonly
PlayerSession[]
Defined in: packages/prismarine/src/network/replica/EntityReplication.ts:195
The sessions of the world's players, which every audience is drawn from.
Returns
readonly PlayerSession[]
Type Aliases
EntityReplicationCounts
EntityReplicationCounts =
object
Defined in: packages/prismarine/src/network/replica/EntityReplication.ts:219
What entity replication has done, by count, for reports and tests.
Properties
firstSightEncodes
readonlyfirstSightEncodes:number
Defined in: packages/prismarine/src/network/replica/EntityReplication.ts:223
First-sight batches encoded, one for each entity, codec and compression group a flush showed it to.
firstSights
readonlyfirstSights:number
Defined in: packages/prismarine/src/network/replica/EntityReplication.ts:225
First-sight batches handed to a client.
visited
readonlyvisited:number
Defined in: packages/prismarine/src/network/replica/EntityReplication.ts:221
Entities whose changes a flush looked at.