Skip to content

Commit 0ceab01

Browse files
committed
Update README.md to include some information on the event system
1 parent ac49ae2 commit 0ceab01

File tree

1 file changed

+21
-11
lines changed

1 file changed

+21
-11
lines changed

README.md

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# Hypixel Mod API
22

3-
The Hypixel Mod API is an implementation of custom packets for communicating with the Hypixel Server via plugin messages.
3+
The Hypixel Mod API is an implementation of custom packets for communicating with the Hypixel Server via plugin
4+
messages.
45

5-
Currently, the API is in an early preview state to gather community feedback. The API is subject to change and may be
6-
altered or disabled at any time. You can read more about on
6+
Currently, the API is in an early preview state to gather community feedback. The API is subject to change and may be
7+
altered or disabled at any time. You can read more about on
78
the [announcement forum thread](https://hypixel.net/threads/hypixel-mod-api-developer-preview-feedback.5635119/).
89

9-
1010
## Mod Distributions
1111

1212
Official downloads of the Hypixel Mod API can be found on [Modrinth](https://modrinth.com/mod/hypixel-mod-api).
13-
To install the mod, simply download the JAR file and place it in your mods folder.
13+
To install the mod, simply download the JAR file and place it in your mods folder.
1414

1515
Currently, the Hypixel Mod API supports the following mod loaders and versions:
1616

@@ -19,13 +19,13 @@ Currently, the Hypixel Mod API supports the following mod loaders and versions:
1919

2020
If there is significant demand, support for additional versions and loaders may be considered.
2121

22-
2322
## Developer Usage
2423

25-
For using the Mod API you will need to add it as a dependency to your project. This can be done via the public
24+
For using the Mod API you will need to add it as a dependency to your project. This can be done via the public
2625
Hypixel Maven repository.
2726

2827
```xml
28+
2929
<repository>
3030
<id>Hypixel</id>
3131
<url>https://repo.hypixel.net/repository/Hypixel/</url>
@@ -43,6 +43,7 @@ repositories {
4343
You can then include the dependency in your project.
4444

4545
```xml
46+
4647
<dependency>
4748
<groupId>net.hypixel</groupId>
4849
<artifactId>mod-api</artifactId>
@@ -56,7 +57,8 @@ dependencies {
5657
}
5758
```
5859

59-
Depending on your chosen mod loader, you will need to also include the `hypixel-mod-api` as a required dependency. For example in Fabric you would include the following in your `fabric.mod.json` file.
60+
Depending on your chosen mod loader, you will need to also include the `hypixel-mod-api` as a required dependency. For
61+
example in Fabric you would include the following in your `fabric.mod.json` file.
6062

6163
```json
6264
{
@@ -68,7 +70,8 @@ Depending on your chosen mod loader, you will need to also include the `hypixel-
6870

6971
## Example Usage
7072

71-
Once you have the API added to your project you can start using it. Below are examples of sending server-bound packets, as well as receiving client-bound packets.
73+
Once you have the API added to your project you can start using it. Below are examples of sending server-bound packets,
74+
as well as receiving client-bound packets.
7275

7376
### Sending a Hypixel Packet
7477

@@ -95,12 +98,19 @@ public class Example {
9598

9699
### Subscribing to a packet event
97100

98-
If you wish to receive a specific event packet, you will need to subscribe to the event. Once subscribed you can register a packet handler as normal (see example above).
101+
If you wish to receive a specific event packet, you will need to subscribe to the event. Once subscribed you can
102+
register a packet handler as normal (see example above).
99103

100104
```java
101105
public class Example {
102106
public void subscribeToPacketEvent() {
103107
HypixelModAPI.getInstance().subscribeToEventPacket(ClientboundLocationPacket.class);
104108
}
105109
}
106-
```
110+
```
111+
112+
Registering for an event packet is only required one time during the Minecraft client lifecycle. You can register for
113+
event packets at anytime, including in your mod initialization code before the player has connected.
114+
115+
The implementation of the Mod API will automatically notify the server of any registered events when receiving
116+
the `ClientboundHelloPacket`.

0 commit comments

Comments
 (0)