HomeJavaModsDiamondPacketLib
DiamondPacketLib
Advanced Spigot Packet Library
DiamondPacketLib is a Spigot Packet Library optimzied for 1.8 - latest Minecraft Versions that made working with Packets as easy as using CraftBukkit Events

(The Code follows Google Checkstyle)

Features
How to use
You may know the CraftBukkit PlayerJoinEvent, it is just as easy to use the DiamondPacketReceiveEvent or the DiamondPacketSendEvent event, the first event is called as soon as the player sends a packet to the server and the other event as soon as the server sends a packet to the player. (Both can be canceled). The events pass you an object called Packet which is the packet the event catches through the ChannelDuplexHandler, additionally it passes you directly the player who sent it or should be sent to, just like you can cancel everything.

Example
Code (Text):
 @EventHandler
public void onReceive(DiamondPacketReceiveEvent event) {
   final Player player = event.getPlayer();
   
   if(event.getPacket().getClass().getSimpleName().equalsIgnoreCase("PacketPlayInEnchantItem")) {
       event.setCancelled(true);
       player.sendMessage("§cEnchanting Items is not cool!");
   }
}
 

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.

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

Explore more