Skip to main content

Utilities for serializing and deserializing Hypixel's plugin message API

Works with
This package works with Bun
This package works with Node.js
This package works with Deno
JSR Score
100%
Published
a month ago (0.3.3)

Hypixel Plugin Message API

A self-contained API for using the Hypixel plugin messages API. Uses @lilithmod/unborn-mcproto (on NPM) for packet reading and writing, but is compatible with node-minecraft-protocol and any other library that exposes plugin messages as buffers as well.

All enums from https://github.com/HypixelDev/HypixelData are converted automatically into string representations. The only current exception is ServerType, which currently returns its raw string.

See the announcement thread for more information.

Adapted based on: https://github.com/HypixelDev/ModAPI

Currently up-to-date with ModAPI release 0.2.1

Installation

npx jsr add @lilith/hypixel-plugin-message-api
yarn dlx jsr add @lilith/hypixel-plugin-message-api
pnpm dlx jsr add @lilith/hypixel-plugin-message-api
bunx jsr add @lilith/hypixel-plugin-message-api

Usage

import { readClientboundPacket, writeServerboundPacket } from '@lilith/hypixel-plugin-message-api'

const request: Buffer = writeServerboundPacket('ping', { version: 1})

// Send buffer as plugin message with channel hypixel:ping

const response: Buffer // Received buffer from clientbound plugin message with channel hypixel:ping

const packet = readClientboundPacket('ping', buffer) // { version: 1, response: "pong" }
Built and signed on
GitHub Actions
View transparency log

Add Package

deno add @lilith/hypixel-plugin-message

Import symbol

import * as mod from "@lilith/hypixel-plugin-message";

Add Package

npx jsr add @lilith/hypixel-plugin-message

Import symbol

import * as mod from "@lilith/hypixel-plugin-message";

Add Package

yarn dlx jsr add @lilith/hypixel-plugin-message

Import symbol

import * as mod from "@lilith/hypixel-plugin-message";

Add Package

pnpm dlx jsr add @lilith/hypixel-plugin-message

Import symbol

import * as mod from "@lilith/hypixel-plugin-message";

Add Package

bunx jsr add @lilith/hypixel-plugin-message

Import symbol

import * as mod from "@lilith/hypixel-plugin-message";