PacketApi
Packet-API is a simple API that allows you to intercept packets that are being constantly exchanged between the client and the server. Packet-API should be packed with your plugin source when exporting your plugin
Versions below 1.8.8 are currently not supported but in future I will add 1.7.10 support.
Usage
Using the API is really simple. To start you will have to create a new instance of the API and start it.
public class SamplePlugin extends JavaPlugin {
@Override
public void onEnable() {
new PacketApi(this).start();
}
}
Intercepting Packets
1) Intercepting all packets that are in connection with a player by passing in the player in the PlayerPacketListener as shown below
PacketApi.getPacketApi().register(new PlayerPacketListener(player) {
@Override
public boolean onPacket(Player player, Packet packet) {
return false;
}
});
2) Second way of doing it is by registering a PacketListener and passing all the packet names in the constructor that you want to intercept.
PacketApi.getPacketApi().register(new PacketListener("PacketPlayInPosition") {
@Override
public boolean onPacket(Player player, Packet packet) {
return false;
}
});
3) The last way of doing it is intercepting all packets that are going between the clients and the server.
PacketApi.getPacketApi().register(new PacketHandler() {
@Override
public boolean onPacketSend(Player player, Packet packet) {
return false;
}
@Override
public boolean onPacketReceive(Player player, Packet packet) {
return false;
}
});
Download
Maven
<repository>
<id>ihaq-maven</id>
<url>http://maven.ihaq.me/libs-maven/</url>
</repository>
<dependency>
<groupId>me.mat1337</groupId>
<artifactId>packet-api</artifactId>
<version>1.0</version>
</dependency>
Gradle
repositories {
maven {
url "http://maven.ihaq.me/libs-maven/"
}
}
dependencies {
compile 'me.mat1337:packet-api:1.0'
}Similar projects
Plugin →Let Me Despawn
Improves performance by tweaking mob despawn rules. Say bye to pesky unintentional persistent mobs.
25MSueta
JourneyMap
Real-time map used for mapping in-game or your browser as you explore.
14.7MSueta
Emotecraft
Create your own emotes in Minecraft.
7.5MSueta
Simple Tpa
A simple tpa plugin which sends requests
5.4MSueta
Common Network
Forge and Fabric Unified Networking Solution
3.9MSueta
Set Home
A lightweight plugin for players to set their homes.
3.8MSueta