UNPKG

moomooio-client

Version:

MooMooIO-Client is a client-side wrapper API designed for the game MooMoo.io. This package aims to provide a simple yet powerful API for creating clones, mods, or plugins for MooMoo.io.

22 lines (17 loc) 751 B
import { z } from "zod"; const schema = z.tuple([z.number(), z.number()]); /** * @packet-id "h" * @description **UpdateHealth** is a signal that contains information about a player's new health. * @member `playerID` is a special code that identifies the player whose health has changed. * @member `playerHealth` represents the player's updated health value. */ export default class UpdateHealth { public static readonly PACKET_ID = "h"; public static readonly PACKET_NAME = "UpdateHealth"; public readonly PACKET_NAME = "UpdateHealth"; constructor(readonly playerID: number, readonly playerHealth: number) {} static parse(data: unknown): UpdateHealth { return new UpdateHealth(...schema.parse(data)); } }