[API] PacketListenerAPI icon

[API] PacketListenerAPI -----

Simple API to manipulate sent and received packets | compatible with all versions




1.18 support
----------, Mar 27, 2022

dependency update
----------, Dec 27, 2021

fixed an issue with sending packets
----------, Aug 15, 2021

1.17 support
----------, Jun 20, 2021

  • Removed APIManager support, which should fix some issues with class loading
----------, Jun 7, 2021

Updated dependency
----------, May 28, 2021

Code (Text):
<dependency>
        <groupId>org.inventivetalent.packetlistenerapi</groupId>
        <artifactId>api</artifactId>
        <version>3.9.0-SNAPSHOT</version>
    </dependency>
----------, May 15, 2021

* fixes
* java 9+ recommended now
----------, Feb 12, 2021


Fixed an issue with 1.16.2 ( #71)
----------, Aug 26, 2020

1.16.2 support
----------, Aug 14, 2020


  • updated ReflectionHelper
  • *should* support 1.15
----------, Dec 17, 2019

1.14 support
----------, May 31, 2019

  • fixes a startup error complaining about a missing field in the update checker
----------, Mar 17, 2019

  • updated reflection helper for 1.13.1
----------, Aug 27, 2018

  • updated reflection helper to support 1.13
----------, Jul 22, 2018

1.12 support
----------, Jun 16, 2017

  • added bStats to replace MCStats
----------, Feb 4, 2017


  • updated some dependencies to support 1.11 properly
  • removed MCStats
  • added spiget updater
----------, Feb 1, 2017

  • possibly fixed an exception that could occur sometimes when starting/stopping the server
----------, Jul 2, 2016

  • updated ReflectionHelper for 1.10 support
----------, Jun 9, 2016

  • fixed compatibility issues with 1.9.4
  • added methods to get packet fields by their index
----------, May 27, 2016

  • fixed download
----------, May 10, 2016

  • added support for Spigot 1.9.4
----------, May 10, 2016

  • fixed compatibility with ProtocolSupport
----------, Apr 6, 2016

  • updated ReflectionHelper
----------, Apr 6, 2016


  • fixed some imports which depended on the deprecated API
----------, Mar 10, 2016

----------, Mar 9, 2016

----------, Mar 9, 2016

----------, Mar 5, 2016

  • added methods to access the Channel of server-packets
----------, Mar 5, 2016

  • fixed PacketOptions for onReceive
----------, Mar 4, 2016

  • ReflectionHelper fix for versions < 1.9
----------, Mar 2, 2016

  • Added support for 1.9
  • Minor PacketHandler optimizations
  • Removed PacketSendEvent & PacketReceiveEvent
  • Updated maven artifact to org.inventivetalent.packetlistener:api
----------, Mar 2, 2016

  • fixed compatibility issues
    • now (hopefully) supports ProtocolSupport
----------, Jun 1, 2015

  • fixed player disconnects when reloading the server
    • Don't use /reload anyways.
----------, May 6, 2015

  • fixed @PacketOptions annotation functionality
  • fixed missing player objects for incoming packets
----------, Apr 17, 2015

  • proper toString method for Packets
  • added method PacketHandler.sendPacket(Player, Object) to send packets
  • added method PacketHandler.cloneObject(Object) to clone an Object (e.g. Packet)
----------, Mar 28, 2015

  • PacketHandler constructor with plugin instance
----------, Mar 28, 2015

  • Code (Java):
            PacketHandler. addHandler ( new PacketHandler ( ) {

                @Override
                @PacketOptions (forcePlayer = true )
                public void onSend (SentPacket packet ) {
                }

                @Override
                @PacketOptions (forceServer = true, forcePlayer = false )
                public void onReceive (ReceivedPacket packet ) {
                }
            } ) ;
    added @PacketOptions annotation
    • allows you to limit processed packets to either player or server packets
----------, Mar 23, 2015

  • fixed players in packets being overridden by the server listener, which meant you could not get the packet receiver from player packets
----------, Mar 23, 2015

  • fixed packet replacement (packet.setPacket)
----------, Mar 23, 2015

  • removed exception messages for server-packets
----------, Mar 22, 2015

  • added support for non-player packets
    • will still be handled through the 'onSend' & 'onReceive' methods without a player
  • added 'hasPlayer' method to packets
----------, Mar 21, 2015

  • update by @Dablakbandit to make the API version independent
----------, Mar 19, 2015

  • switched to PacketHandlers instead of events
    • events are still available for compatibility
Code (Java):

    PacketListenerAPI. addPacketHandler ( new PacketHandler ( ) {

            @Override
            public void onSend (SentPacket packet ) {
            }

            @Override
            public void onReceive (ReceivedPacket packet ) {
            }

        } ) ;
 

Events might be convenient to use, but they are not very efficient.
For example, calling the send or receive event takes 30 milliseconds on average.
That may not sound much, but compared to the new method, events are way slower.
The PacketHandlers never took over 1 millisecond to call while testing, so scaled to bigger servers it is a lot more efficient.
----------, Mar 16, 2015

  • removed unnecessary exception
----------, Mar 15, 2015

  • updated to Spigot 1.8.3
----------, Mar 12, 2015

  • fixed problems with the (asynchronous) packet events
----------, Mar 6, 2015

  • removed unnecessary exception on player disconnect
----------, Mar 5, 2015

Updated download URL
----------, Feb 17, 2015

----------, Feb 13, 2015

Fixed the java.util.NoSuchElementException Exception on Player disconnect.
----------, Jan 7, 2015

Updated to all Versions of 1.7 and 1.8
----------, Jan 7, 2015

Updated to 1.8. (Automatically injects the Events for the correct Server version.)
----------, Jan 6, 2015

Resource Information
Author:
----------
Total Downloads: 159,584
First Release: Jan 5, 2015
Last Update: Mar 27, 2022
Category: ---------------
All-Time Rating:
60 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings