PacketInjectorAPI [1.8-1.21.3] - Manage packets easily icon

PacketInjectorAPI [1.8-1.21.3] - Manage packets easily -----

Simple API for managing packets. Powered by LightInjector!



Added support for 1.14 and 1.15
Due to a Spigot change, in 1.14.x and later versions you have to use these methods instead of the classic ones:
Code (Java):
PacketEventManager. registerSendListener (event -> {
    Object packet = event. getPacket ( ) ;
    // The old packet class must remain the same as the new one
    event. setPacket (newPacket ) ;
    Player player = event. getPlayer ( ) ;
    String packetName = event. getPacketName ( ) ;
    Object value = event. getValue ( "fieldName" ) ;
    event. setValue ( "fieldName", value ) ;
    event. setCancelled ( true ) ;
} ) ;

PacketEventManager. registerRetriveListener (event -> {
    Object packet = event. getPacket ( ) ;
    // The old packet class must remain the same as the new one
    event. setPacket (newPacket ) ;
    Player player = event. getPlayer ( ) ;
    String packetName = event. getPacketName ( ) ;
    Object value = event. getValue ( "fieldName" ) ;
    event. setValue ( "fieldName", value ) ;
    event. setCancelled ( true ) ;
} ) ;
If you are supporting versions before and after 1.14, you have to
use both events (PacketSendEvent and PacketRetriveEvent) and PacketEventManager.
----------, Dec 20, 2019
Resource Information
Author:
----------
Total Downloads: 4,538
First Release: Jun 20, 2018
Last Update: Oct 26, 2024
Category: ---------------
All-Time Rating:
2 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings