From 10c4b56addf23441685f777f7ac9e4d6e5fd8426 Mon Sep 17 00:00:00 2001 From: extremeheat Date: Sun, 26 May 2024 15:47:03 -0400 Subject: [PATCH] Update index.d.ts --- src/index.d.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/index.d.ts b/src/index.d.ts index 70b86cc..4230852 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -49,7 +49,20 @@ declare module 'minecraft-protocol' { on(event: 'connect', handler: () => PromiseLike): this on(event: string, handler: (data: any, packetMeta: PacketMeta) => PromiseLike): this on(event: `raw.${string}`, handler: (buffer: Buffer, packetMeta: PacketMeta) => PromiseLike): this - on(event: 'playerChat', handler: (data: { formattedMessage: string, plainMessage: string, type: string, sender: string, senderName: string, senderTeam: string, verified?: boolean }) => PromiseLike): this + on(event: 'playerChat', handler: (data: { + // (JSON string) The chat message preformatted, if done on server side + formattedMessage: string, + // (Plaintext) The chat message without formatting (for example no ` message` ; instead `message`), on version 1.19+ + plainMessage: string, + // (JSON string) Unsigned formatted chat contents. Should only be present when the message is modified and server has chat previews disabled. Only on versions 1.19.0, 1.19.1 and 1.19.2 + unsignedContent?: string, + type: string, + sender: string, + senderName: string, + senderTeam: string, + targetName: string, + verified?: boolean + }) => PromiseLike): this on(event: 'systemChat', handler: (data: { positionId: number, formattedMessage: string }) => PromiseLike): this // Emitted after the player enters the PLAY state and can send and recieve game packets on(event: 'playerJoin', handler: () => void): this