ClientEvents
interface ClientEvents {
actionBar: [message: string];
actionBarRaw: [textComponent: TextComponent];
connect: [];
destroy: [];
disconnect: [reason: string];
disconnectRaw: [textComponent: TextComponent];
failedMessage: [message: Message];
loadChunk: [chunkX: number, sectionY: number, chunkZ: number];
message: [message: Message];
playerPosition: [position: BaseVec3];
ready: [];
registryData: [data: RegistryData];
removeEntity: [entityId: number];
spawnEntity: [entity: Entity];
systemMessage: [message: string];
systemMessageRaw: [textComponent: TextComponent];
unloadChunk: [chunkX: number, chunkZ: number];
updateEntity: [entityId: number];
}Source: client.ts:50
Properties
actionBar: [message: string]
The action bar
actionBarRaw: [textComponent: TextComponent]
The raw action bar
connect: []
When the TCP socket connect is initted sucessfully
destroy: []
When the TCP socket connection is destroyed
disconnect: [reason: string]
When the client got disconnected from sevrer
disconnectRaw: [textComponent: TextComponent]
When the disconection come with the raw Text Component
failedMessage: [message: Message]
When a message is failed to be verified against the signature sent with it
loadChunk: [chunkX: number, sectionY: number, chunkZ: number]
When the chunk is loaded
message: [message: Message]
When a chat message got broadcasted
playerPosition: [position: BaseVec3]
When server send Player Position Synchronization packet
Note: this event is not fired when the client is moved by holding the input
ready: []
When the client is ready.
Specifically, when the packet Login (play) is received
registryData: [data: RegistryData]
The registry_data packet
removeEntity: [entityId: number]
When an entity go out of client view distance or despawned
spawnEntity: [entity: Entity]
When an entity is spawned or appeared in the client view distance
systemMessage: [message: string]
The system message
systemMessageRaw: [textComponent: TextComponent]
The raw system message
unloadChunk: [chunkX: number, chunkZ: number]
When the chunk got deleted by the server
updateEntity: [entityId: number]
When an entity is updated, including position, rotation, etc...