/hm-api

Library for interacting with Hypixel's Mod API.

Primary LanguageJavaApache License 2.0Apache-2.0

HM API

HM API is a library that fully implements Hypixel's Mod API on Fabric 1.21+, HM API is built with modern Java 21 features in mind as well as providing a flexible, and easy to use interface for developers to work with.

Supported Packets:

  • hypixel:party_info (v2)
  • hypixel:player_info
  • hypixel:register
  • hyevent:location

The ping packet is unsupported due to it serving as more of a test for implementations, and also because vanilla has its own QueryPingC2SPacket which achieves the same functionality.

Mods using HM API

Requirements

Usage

You can import HM API into your project like this:

First, add the following Maven repository to your build.gradle file.

repositories {
	exclusiveContent {
		forRepository {
			maven { url "https://maven.azureaaron.net/releases" }
		}

		filter {
			includeGroup "net.azureaaron"
		}
	}
}

Second, add HM API as a mod dependency which will be JiJ'ed with your mod.

dependencies {
	include modImplementation("net.azureaaron:hm-api:<latest version>")
}

Once you've imported the library, you can find the methods to send packet's to Hypixel's Mod API in the HypixelNetworking class. In order to listen to packets you'll need to register to the appropriate event inside of the HypixelPacketEvents class.

Important

There is an example available here with some code to get you started. It's also recommended to read the JavaDocs of these classes to get a sense of how the library works.

Future Changes

The library has been designed with forwards compatibility in mind which is why if Hypixel releases a new version of a packet then support for it will be added in a separate version-specific package to avoid API breakages, and the old packet will be deprecated for removal at a later date. It's highly recommended to stay up-to-date with changes to Hypixel's Mod API and this library.

I'll likely hold off on making breaking API changes to the library until a new Minecraft version releases or if Hypixel makes their own breaking changes to the Mod API. Note that APIs marked as internal or experimental in the library may be broken at any time without notice.

Maintaining

HM API will only be maintained for the latest verions of Fabric API and Minecraft, it will also be kept up to date with any changes made to Hypixel's Mod API (e.g. new packets, deprecations).

Special Thanks

  • nea89: For assisting in making this implementation fully compatible with other implementations via Mixins.
  • The Skyblocker Team: For providing insight on the design.
  • Hypixel: For creating the Mod API and its library from which this design was referenced.