PacketInjectorAPI

PacketInjectorAPI 3.1.2

Native Minecraft Version:
1.20
Tested Minecraft Versions:
1.81.91.101.111.121.131.141.151.161.171.181.191.20
Source Code:
Donation Link:
Packet Injector API

Manage packets easily.
If you're running from 1.8.x to the latest version, use the latest release.
If you're running on 1.7.x, use the 1.3.2 release.

Javadoc: https://frengor.com/javadocs/PacketInjectorAPI/build-server/
Jenkins: https://jenkins.frengor.com/job/PacketInjectorAPI/

To listen to packet simply create and register a PacketListener:
Code (Java):
PacketEventManager eventManager = PacketInjectorPlugin.getInstance().getPacketInjectorAPI().getEventManager();
eventManager.registerPacketListener(pluginInstance, new PacketListener() {
@Override
public void onSend(PacketSendEvent event) {
// code
}

@Override
public void onReceive(PacketReceiveEvent event) {
// code
}
});
PacketInjectorAPI uses LightInjector to inject packets. Hence, the API supports every packet supported by LightInjector, so every game packet and some login packets. For the latters, a Player instance might not be always available. In this case, calling event.getPlayer() will return null.
See LightInjector javadoc for more information.

Spoiler: Events Methods







You can also register send and retrive events separately (even using lambdas):
Code (Java):
eventManager.registerPacketSendListener(pluginInstance, event -> {
// code
});

eventManager.registerPacketReceiveListener(pluginInstance, event -> {
// code
});
Example Usage:

Banning a word:
Spoiler: Banning a word from chat


















Commands:
The plugin comes with a packet logger which can printing every packet (or only certain packets) to the console. It is managed using the following commands:

Spoiler: Commands































Maven:
HTML:
<repositories>
<repository>
<id>fren_gor</id>
<url>https://nexus.frengor.com/repository/public/</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>com.frengor</groupId>
<artifactId>packetinjectorapi</artifactId>
<version>3.1.2</version>
<scope>provided</scope>
</dependency>
</dependencies>
Bugs should be reported opening an issue on GitHub.
BUG REPORTS IN THE REVIEWS WILL NOT BE CONSIDERED!

For bugs: GIT HUB

Metrics
Author
Mined
Downloads
10
Views
17
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from Mined

Top