PacketEvents API icon

PacketEvents API -----

PacketEvents is an open-source Packet Processing API.



NEW LISTENING SYSTEM AND BUG FIXES
Changelog

Bug fixes
• Resolving ClientVersion on BungeeCord servers fixed.

New Custom Exceptions
• PacketEventsLoadFailureException exception thrown if PacketEvents fails to load.
• PacketEventsMethodAccessException exception thrown if PacketEvents fails to access a method of a PacketListener for invoking.
• PacketEventsMethodInvokeException exception thrown if an exception is thrown from the invoked method in the PacketListener.
• PacketEventsNMSCachedEntityNotFoundException exception created and is thrown when the cached entity in an “Entity By ID” lookup isn’t found.
Can be thrown when accessing entity in multiple different wrappers, like the WrappedPacketInUseEntity#getEntity().

New Features
• PacketListenerDynamic, you can now register listeners differently and more dynamically.
Code (Text):

PacketListenerDynamic listener= new PacketListenerDynamic(PacketEventPriority.NORMAL) {
            @Override
            public void onPacketReceive(PacketReceiveEvent event) {
                if(event.getPacketId() == PacketType.Client.CHAT) {
                    event.getPlayer().sendMessage("You sent a message!");
                }
            }
        };
        PacketEvents.getAPI().getEventManager().registerListener(listener);
 
Why should you switch?
The previous system is much slower than this new system as we are forced to use reflection to cal your methods.
The previous system didn’t call the event methods in any order, this new system calls the lowest priorities first and the highest priorities last.

Deprecations
• The previous packet listening system.
It is recommended to slowly start switching to the new system.
The new system performs much faster, is cleaner, overall better.

Removed
• PacketEvents.getSettings().useProtocolLibIfAvailable(boolean)
temporarily removed, currently unsupported, so has been removed.
Expect it to be back in the next update.
• ViaVersion and ProtocolSupport ClientVersion lookup utils removed.
----------, Nov 15, 2020
Resource Information
Author:
----------
Total Downloads: 19,576
First Release: Jun 16, 2020
Last Update: Dec 10, 2024
Category: ---------------
All-Time Rating:
50 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings