PacketInjectorAPI [1.8-1.21.3] - Manage packets easily
3.2.1Simple API for managing packets. Powered by LightInjector!
3.2.1latestMinor improvementsOct 26, 2024 · Updated LightInjector to 1.0.4 · Small fixes and improvements3.2.0Add 1.21.1 supportOct 6, 2024 · Added support for Minecraft 1.21.1 · Updated LightInjector to 1.0.33.1.2Add 1.20.2 supportSep 26, 2023 Add support for 1.20.2 Updates LightInjector to 1.0.2 Now the packet logger will display the contents of bundle packets3.1.1Fix late injection on Paper server behind a BungeeCord instanceNov 23, 2022 Updated LightInjector to 1.0.1. This fixes a bug which caused some packets to be lost on Paper servers behind a BungeeCord instance.3.1.0Use LightInjector to inject packetSep 18, 2022 This release makes use of a brand new injector: LightInjector. This change will reduce the burden of maintaining and updating the API to new mc versions. The API itself has not changed, so updating to this version should be as easy as replacing the old jar with the new one. Note, however, that some login packets will not be intercepted anymore starting from this version (game packets are not affected). See the LightInjector javadoc for more information.3.0.2Add 1.19-1.19.2 supportAug 28, 2022 Add support for 1.19-1.19.23.0.1Perfect 1.18 supportDec 4, 2021 · Perfect 1.18 support · Fix command filters not working properly3.0.0Complete rewriteNov 26, 2021 The API has been completely rewritten. It is now more coincise and doesn't require fastutil. Also, it now uses an updated version of TinyProtocol to inject into minecraft and listen to packets. This means that now it is possible to listen to handshake, login, and status packets like PacketLoginInStart. This is how to create a PacketListener with the new API: Code (Java): PacketInjectorPlugin. getInstance ( ). getPacketInjectorAPI ( ). getEventManager ( ). registerPacketListener (plugin, new PacketListener ( ) { @Override public void onSend (PacketSendEvent event ) { // code } @Override public void onReceive (PacketReceiveEvent event ) { // code } } ) ; Please note that now event.getPlayer() can return null in case the player object is not available yet. For example, packet events fired when a player is joining but before PlayerJoinEvent does not provide a Player instance.2.0.0New APISep 8, 2020 Added new API: Code (Java): PacketEventManager. registerPacketListener (pluginInstance, new PacketListener ( ) { @Override public void onSend (PacketSendEvent e ) { // TODO } @Override public void onRetrive (PacketRetriveEvent e ) { // TODO } } ) ; Old API is removed. Add the PacketInjectorAPI-Compatibility plugin to the plugins folder for old api compatibility.1.3.2Added support for 1.14 and 1.15Dec 20, 2019 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.1.3.1FixDec 17, 2019 Sorry for this update, just a small fix1.3.0Added setPacket() MethodDec 17, 2019 Added this methods: Code (Java): public void onPacketSend (PacketSendEvent event ) { // The old packet class must remain the same as the new one event. setPacket (newPacket ) ; } Code (Java): @EventHandler public void onPacketRetrive (PacketRetriveEvent event ) { // The old packet class must remain the same as the new one event. setPacket (newPacket ) ; }1.2.1Fixed BugDec 28, 2018 Another update to try to fix completely the bug of the last update1.2.0Dec 28, 2018 1.9Fixed an error during initializationNov 25, 2018 Fixed an error that occours enabling the plugin1.8Fixed bug with sendPackets methodsSep 7, 2018 Fixed bug with sendPacketToClient and sendPacketToServer methods1.7Added newInstance method to ReflectionUtil - Added metod to packet's eventsSep 7, 2018 - Added method newInstance in the ReflectionUtil class to get a new Instance of a class using the proper constructor: Code (Java): public static Object newInstance (Class <?> clazz, Object... parameters ) ; - Added method to packet's events: Code (Java): public void setValue ( String field, Object value ) ; public Object getValue ( String field ) ; These methods can be optimized in future - Fixed some bugs1.6Send Packets to ServerAug 10, 2018 With PacketInjectorAPI class you are enable to send packet not only to the client, but also to the server! Code (Java): public static void sendPacketToClient (Player player, Object packet ) public static void sendPacketToServer (Player player, Object packet )1.5Added getPacketName method to eventsAug 8, 2018 Added getPacketName method to send and retrive events Code (Java): public String getPacketName ( ) ;1.41.13 updateJul 23, 2018 Added 1.13 compatibility1.3Universal Events UpdateJul 2, 2018 Now you can use PacketRetriveEvent and PacketSendEvent in all the version. Use PacketRetriveEvent_v1_7 and PacketSendEvent_v1_7 only if you want ChannelHandlerContext and ChannelPromise objects. In 1.8 and later version you can get ChannelHandlerContext and ChannelPromise objects with these events: PacketRetriveEvent_v1_8 PacketSendEvent_v1_81.2MetricsJun 22, 2018 Added Metrics using bStats1.1Bug fix - 1.7 support addedJun 21, 2018 Fixed Bugs - 1.7 support added For 1.7 use these events: PacketSendEvent_v1_7 PacketRetriveEvent_v1_71.0Jun 20, 2018
Similar projects
Plugin →Let Me Despawn
Improves performance by tweaking mob despawn rules. Say bye to pesky unintentional persistent mobs.
26.2MSueta
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.9MSueta
Simple Tpa
A simple tpa plugin which sends requests
5.4MSueta
Common Network
Forge and Fabric Unified Networking Solution
4.7MSueta
Set Home
A lightweight plugin for players to set their homes.
3.8MSueta