Home›Java›Mods›PacketPacket
PacketPacket
ModsJava

PacketPacket

Java mod listed for Minecraft 1.8–1.17. Downloads from the MC Java Mods app on Android.

⬇ Download on Spigot
This Library / API is designed for simple and easy listening, cancelling and sending of packets.

Packet listening and cancelling can be done the same simple way as event listening and cancelling which is why this was made for.

PacketPacket contains custom packet classes with the same name as the original packet classes but with an extra " P" in the beginning so the packet you're looking for shouldn't be hard to find.

For example, PacketPlayOutChat is PPacketPlayOutChat, PacketPlayOutBlockChange is PPacketPlayOutBlockChange and so on..

If you have any problems with PacketPacket, please message me.
Make sure to not /reload every so often.

Some Examples of PacketPacket
Spoiler: Creating a PacketListener Class
Code (Java):
package aPackage ;

import dev.pixelmania.packetpacket.packet.PPacketPlayInChat ;
import dev.pixelmania.packetpacket.packet.PacketHandler ;
import dev.pixelmania.packetpacket.packet.PacketListener ;
import dev.pixelmania.packetpacket.packet.PacketPriority ;

public class AClass implements PacketListener {
    @ PacketHandler ( priority = PacketPriority. HIGHEST, ignoreCancelled = false )
    public void aMethod (PPacketPlayInChat packet ) {
        packet. setCancelled ( true ) ;
        System. out. println ( packet. getPlayerName ( ) + " : " + packet. isCancelled ( ) ) ;
    }
}

// Class must implement "dev.pixelmania.packetpacket.packet.PacketListener" as shown above.
// priority and ignoreCancelled is optional for @ PacketHandler.
// all the packet names are the same as Bukkit's but just add an extra "P" to the beginnning.
// ( "PacketPlayInChat" - from Bukkit is "PPacketPlayInChat" - from PacketPacket )

Spoiler: Registering a PacketListener Class
Code (Java):
package aPackage ;

import org.bukkit.plugin.java.JavaPlugin ;

import bPackage.APacketListenerClass ;
import dev.pixelmania.packetpacket.PacketPacket ;

public class AClass extends JavaPlugin {
    @ Override
    public void onEnable ( ) {
        PacketPacket. registerPackets ( new APacketListenerClass ( ), this ) ;
    }
}

// Registering packets is the same as if you were registering Bukkit events as shown above and below.
// Bukkit.getPluginManager().registerEvents( new EventListenerClass(), this ); << Bukkit Event Registering
// ;
// PacketPacket.registerPackets( new PacketsListenerClass(), this); << Packets Registering
// Very simple.

An example plugin using PacketPacket


If you like PacketPacket, then please consider leaving a review!
If your plugin uses PacketPacket, message me and I will add it to the list below.


Plugins using this Library / API ;
- n/a

Make sure to add PacketPacket as depend in your plugin.yml!

You can use priority and ignoreCancelled when using @ PacketHandler above a method just like with an event's EventHandler.
Code (Java):
@ PacketHandler ( priority = PacketPriority. HIGH, ignoreCancelled = true )
Registering a PacketListener class ( The class has to implement PacketListener from PacketPacket )
Code (Java):
PacketPacket. registerPackets ( PacketListener, JavaPlugin ) ;
Sending a packet to a player
Code (Java):
PacketPacket. sendPacket ( Player, Packet ) ;
Default methods of PacketPacket packets
Code (Text):
// Returns a Player object
.getPlayer();

// Returns a String object
.getPlayerName();

// Sets if the packet will be cancelled
.setCancelled( boolean );

// Returns a boolean value
// true = Packet is cancelled
// false = Packet is not cancelled
.isCancelled();
@ PacketHandler parameters
Code (Java):
@ PacketHandler ( priority = PacketPriority. [PRIORITY ], ignoreCancelled = [ boolean ] )

// The parameters of @ PacketHandler are optional.

// PacketPriority is from LOWEST to MONITOR

// If ignoreCancelled = true then the method under @
// PacketHandler will not be called if the packet is cancelled.

Plugin details

Read from the plugin's own plugin.yml.

Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

PacketPacket is a free Minecraft Java mod. Compatible with Minecraft 1.8, 1.9, 1.10, 1.11 and newer. Downloaded 382 times (via Spigot). Download it and open it directly in the game.

Explore more