PacketEvents API icon

PacketEvents API -----

PacketEvents is an open-source Packet Processing API.




PacketEvents v2.7.0 is out now!
New update with support of the latest Minecraft version. In addition to that, countless bugs were fixed.
Brief Announcement ⚠️
We have our own website: https://packetevents.com
Documentation: https://docs.packetevents.com
JavaDocs: https://javadocs.packetevents.com

What's Changed? (Summary)
  • Added 1.21.4 support
  • Fix: Potion contents item component for 1.21.2/1.21.3
  • Fix: NPC objects to have unique server team names
  • Add missing ServerVersion#V_1_9_1
  • Validation checks added for window click type
Full Changelog: https://github.com/retrooper/packetevents/compare/v2.6.0...v2.7.0

New Contributors
Contributors
This update wouldn't be possible without these contributors ❤️: @booky10, @rafi67000, @ShreyasAyyengar, @AoElite, @Tecnio, @Axionize, @mfnalex

If you want to support PacketEvents, and any upcoming events we plan for the future, consider sponsoring us on GitHub Sponsors
Maven/Gradle Dependency
Check out: https://docs.packetevents.com/getting-started
----------, Dec 10, 2024

PacketEvents v2.6.0 is out now!
New update with support of new platforms & the latest Minecraft version. In addition to that, countless bugs were fixed.

Brief Announcement ⚠️
• We have our own website: https://packetevents.com
• Documentation: https://docs.packetevents.com
• JavaDocs: https://javadocs.packetevents.com

What's Changed (Summary)
• 1.21.2 and 1.21.3 Minecraft support
• Sponge support added
• Fabric support added (also server-side)
• Utilizing the proper bStats API
• Registry element issues fixed
• Mappings issues fixed
• AdvancedSlimePaper issues fixed
• BungeeCord issues fixed

Full Changelog: https://github.com/retrooper/packetevents/compare/v2.5.0...v2.6.0

Contributors
This update wouldn't be possible without these contributors ❤️: @booky10, @ManInMyVan, @SamB440, @rafi67000, @Bram1903, @AbhigyaKrishna

If you want to support PacketEvents, and any upcoming events we plan for the future, consider sponsoring us on GitHub Sponsors

Maven/Gradle Dependency
Check out: https://docs.packetevents.com/getting-started
----------, Nov 3, 2024

New PacketEvents release here!
New update with performance improvements & bug fixes!

Brief Announcement (Some of these are still WIP⚠️)
We have our own website https://packetevents.com
Documentation: https://docs.packetevents.com
JavaDocs: https://javadocs.packetevents.com
If you want to support PacketEvents, and any upcoming events we plan for the future, consider sponsoring us on GitHub Sponsors


Contributors
This update wouldn't be possible without these contributors ❤️: @booky10, @AbhigyaKrishna, @KoutaChan, @ShadowOfHeaven , @Bram1903 , @libraryaddict, @AoElite, @rexlManu, @ManInMyVan, @KermanIsPretty, @Elikill58

What's Changed (Summary)
• 1.21.1 Minecraft support
• Added 1.21 Fabric support (currently still only works on the client)
• Support for new BungeeCord changes (dropped support for legacy BungeeCord versions)
• PacketEvents commit-hash made visible in Minecraft Console
• More efficient mappings reading, and event system
• Added network synchronized registries (complete 1.21 support)
• Added WrapperPlayServerBossBar wrapper
• Various bug fixes

Full Changelog: https://github.com/retrooper/packetevents/compare/v2.4.0...v2.5.0

Maven/Gradle Dependency
Check out: https://docs.packetevents.com/getting-started
----------, Sep 20, 2024

New PacketEvents release here!
1.21 Minecraft released a while ago, we are here to publish our first official release that supports it. This release contains various additions and bug fixes. As always, this section is merely a _summary_ of the changes.

Please note that the declaration of the PacketEvents dependency has changed!
Depending on pre‐built PacketEvents
Shading PacketEvents

Changes
• 1.21 Minecraft support
• Gradle build chain reworked (with Kotlin DSL, also have Global Versioning)
• Add support for Mojang mapped JARs
• Add support for all versions of Adventure v4
• Added immutable views on the values within our registries
• Reworked PEVersion
• PacketEvents switched to the Paper API to optimize Folia functionality (The Spigot platform is still supported)
• ChatMessage_v1_19_1.ChatTypeBoundNetwork replaced with ChatType.Bound
• NBT and Component methods added to the ItemStack builder
• PacketEvents bStats setting is obsolete as it can be toggled within the configuration file created on the server
• PacketWrapper#writeVarInt optimization
• Event system optimization

Bug fixes
• Fix chat type mappings (1.19+)
• Fix Particle mappings for 1.12.2
• Fix Encoding the EncryptionResponse wrapper
• Fix SpigotConversionUtil#getEntityById for modern versions
• Fix Spigot Particle Conversion
• Fix Recipe Packet Read/Write
• Fix SoundEffect for legacy Minecraft versions
• Account for zero data in ChunkData packet (when unloading)
• Fix NPC#despawnAll, NPC#changeSkin
• Fix WrapperPlayServerJoinGame's reading of enforcesSecureChat
• Fix WrapperPlayServerChunkDataBulk not being copied from one listener to another
• Fix platform version detection on Velocity and BungeeCord
• Fix BungeeCord injector

Known issues
This PacketEvents update was a rather large one. We acknowledge that it still has a few issues and plan on fixing them in the upcoming patch update.
1. MappedEntity#isRegistered call leads to NullPointerException
Network synched registries are currently being worked on. < https://github.com/retrooper/packetevents/pull/866>
Completion of this task should lead to the issue being resolved.

2. EntityMetadata issues on 1.20.5+
Some metadata types (eg. spawned wolves) cause issues due to them being implemented incorrectly. Also this, we plan on fixing in the next patch update.

Help PacketEvents / Donations
Maintaining PacketEvents is not a simple process. The project has grown a lot and some of you have been here to witness it all. PacketEvents now has two additional maintainers: booky10 and AbhigyaKrishna. If you are willing to extend your kindness to them also, please reach out.
----------, Jun 30, 2024

Changelog
• 1.20.5/1.20.6 support
• Fixed incompatibility with ViaVersion
• Slow but steady introduction of the Fabric module (not stable)
• Compress mappings within PacketEvents to reduce file size
• Optimizations to event handling
• SpigotConversionUtil#getEntityById added (works on all versions now)
• Implemented proper memory management on proxy
• Implemented the setting to kick players after receiving an exception
• Implemented Location#getDirection
• Various functionality in SpigotConversionUtil fixed
• JoinGame issues on 1.16/1.16.1 fixed
• Redesign of FoliaScheduler utility within PacketEvents
• Potions class implemented (The PotionTypes class is for entity effects, the Potions class for the potions available in the creative inventory)
• Odd downsampling of colors fixed
• Fix UUID serialization with Adventure
• Fixes for WrapperPlayServerDeclareCommands

Learn how to use 2.3.0 by following our Wiki
Depending on pre-built PacketEvents
----------, May 8, 2024

Changelog
• Added testing of item tags
• Fix NPCs not spawning on modern versions
• Fix Level NBT missing on enchanted items exception
• WrapperPlayServerScoreboardObjective & WrapperPlayServerUpdateScore fixed on 1.20.3/1.20.4
• Fix Vector3i#subtract
• Addition of VillagerLevel, Rotation, Color and DyeColor
• Fix WrapperPlayServerResourcePackSend in 1.16
• Fix packet re-encoding on Velocity
• Fix certain server listing websites failing to ping PacketEvents servers
• Properly read isFrontText in sign edit wrappers
• Account for an entity eye field in ParticleVibrationData
• Fix GSON component serialization on modern versions
• Correct the maximum durability of ItemTypes.NETHERITE_HELMET
• Fix MojangAPIUtil#requestPlayerTextureProperties(UUID)
• Add new 1.20.4 entity poses
• Addition of WrapperPlayServerActionBar
• Fix player instances being null after a reload
• Fix bStats metrics on velocity module
• Increase AdventureNBTSerialization.DEPTH_LIMIT to 512

Learn how to use 2.2.1 by following our Wiki
Depending on pre-built PacketEvents
----------, Feb 11, 2024

Changelog
* Support for 1.20.3/1.20.4 Minecraft
* Initialization Optimization on Spigot
* bStats implemented for Velocity
* bStats implemented for BungeeCord
* EntityMetadataProvider#entityData(ClientVersion) added and EntityMetadataProvider#entityData() deprecated!

Learn how to use 2.2.0 by following our Wiki
Depending on pre-built PacketEvents
----------, Dec 24, 2023

Changelog
• Support for 1.20.2
• Minor bug fixes (Channel finding on modern versions, MerchantOffers wrapper, Some Adventure API exceptions)

API Additions
• PacketConfigReceiveEvent, PacketConfigSendEvent
• EntityMetadataProvider interface created, allowing external PacketEvents Addons to provide more advanced abstraction to our entity metadata system

Learn how to use 2.1.0 by following our Wiki
Depending on pre-built PacketEvents
----------, Nov 27, 2023

Bug fixes
• WrapperPlayServerChunkData index out of bounds exceptions when used fixed

Learn how to use 2.0.0 by following our Wiki
----------, Sep 13, 2023

Summary

Bug fixes
• Sending packets now works on proxies no matter the client version of the target. Just make sure the specific wrapper exists on the target's server version.
• Minor fix to item mappings for versions 1.12 and older
• Added missing constructors, getters and setters for WrapperPlayServerHurtAnimation

API additions
• You can now detect if the current platform is a proxy or not
Code (Java):
boolean proxy = PacketEvents. getAPI ( ). getInjector ( ). isProxy ( ) ;

Learn how to use 2.0.0 by following our Wiki
Thanks for all the support after the 2.0.0 release, here is a patch update, please update to this for the latest bug fixes and features.
----------, Sep 12, 2023

Summary
• We now support versions 1.8 - 1.20.1
• We now have partial support for some new platforms such as Velocity and BungeeCord (Sending packets on proxies is still being worked on)
• Our packet wrapper design has shifted from heavy reflection to utilizing netty's bytebuffers

Learn how to use 2.0.0 by following our Wiki

Thank you to everyone involved in this update. Finally 2.0.0 is out, from now on we will be releasing minor and patch updates.
To all the users that helped us test 2.0.0 by using the snapshot versions, please update to this release.
----------, Aug 23, 2023

1.8.4 is out

• Added support for 2.0 beta PacketEvents. You can now safely run a plugin shading PacketEvents Beta 2.0.0 and another plugin running 1.8.4 without any issues. There used to be an issue where packets sent by 2.0 would be discarded. (cancelled)

• Deprecated PacketEvents#loadAsync and PacketEvents#loadAsyncNewThread. This "feature" was removed in 2.0, so I decided to deprecate it here. It really made no sense having that.
----------, Apr 27, 2022

1.8.3 is out

• Fixed our injector for 1.7.10 servers.
Just a little note to the 1.7.10 users... Dear developers, please forward this to your users.
Consider updating your server to 1.8.8. There shouldn't be anything holding you guys back from updating your network. Run a 1.8.8 server with ViaVersion & ViaBackwards & ViaRewind to still support 1.7.10 clients if you want. I'm trying to eliminate all 1.7.10 server users. 1.7.10 support might be dropped in future releases in exchange for smaller file size & sustainability. We have to use jars thankfully hosted by funkemunky to support 1.7. If these jars ever get taken down, packetevents would not be able to be built, and we'd abruptly have to end 1.7.10 support.
----------, Mar 28, 2022

1.8.2 IS OUT

• Added support for new snapshot versions of ProtocolLib.

Background information
Almost 2 weeks ago, I made an issue on ProtocolLib's GitHub repository. I noticed some flaws in their channel pipeline injector. (In monkey words, how to hack into server code and listen to packets) Thankfully a developer called derklaro improved their injector. This leads to better performance for ProtocolLib.

So why would you care?
If you ever came across a ProtocolLib plugin that modified packets, you'd notice packetevents wouldn't get these modifications. This would lead to player velocity modifying ProtocolLib plugins causing issues, especially for anti-cheats. These snapshot builds of ProtocolLib fix this too. ProtocolLib will always process outgoing packets before us.
----------, Mar 8, 2022

1.8.1 IS OUT

I now release PacketEvents v1.8.1. I've been releasing pre-releases for a while. Our last "stable" release was 1.7.9 which was released in November 2020...
If you are a beta-tester of 2.0 PacketEvents, you can ignore this update.
If you were on a pre-release of v1.8.0 packetevents, please update to this.

We now report to bStats how many users run this PacketEvents version. 2.0 releasing is hopefully around the corner, we currently have just under 100 beta testers. Please join my discord if you have interest in learning more about 2.0.

• Now support 1.18.2
• PacketEvents now uses Geyser 2.0 API. This means very old versions of Geyser won't work.
• No longer injecting NPCs(fake connections).
• WrappedPacketOutEntity(and its subclasses) and WrappedPacketOutEntityHeadRotation constructor accepting rotations now works with normal yaw and pitch as a float. This should hopefully fix bugs with our NPC API rotations breaking.
• Update checker fixed (older packetevents versions will experience issues if that is enabled)
----------, Mar 7, 2022

1.8.0 IS OUT

I now release PacketEvents v1.8.0. I've been releasing pre-releases for a while. Our last "stable" release was 1.7.9 which was released in November 2020...
If you are a beta-tester of 2.0 PacketEvents, you can ignore this update.
If you were on a pre-release of v1.8.0 packetevents, please update to this.

We now report to bStats how many users run this PacketEvents version. 2.0 releasing is hopefully around the corner, we currently have just under 100 beta testers. Please join my discord if you have interest in learning more about 2.0.

• Now support 1.18.2
• PacketEvents now uses Geyser 2.0 API. This means very old versions of Geyser won't work.
• No longer injecting NPCs(fake connections).
• WrappedPacketOutEntity(and its subclasses) and WrappedPacketOutEntityHeadRotation constructor accepting rotations now works with normal yaw and pitch as a float. This should hopefully fix bugs with our NPC API rotations breaking.
----------, Mar 7, 2022

I rarely post updates on SpigotMC, but since the last build on here is really outdated, here you go. This update should have 1.7.10->1.18 support.

Please view the recent release changelogs.

SpigotMC seems to bring quite a bit of attraction, so I will update this page now and then.
----------, Dec 25, 2021


CHANGELOG
I tried to prioritize bug fixes rather than new features to prevent the creation of new bugs in this update.
I tested everything and everything should be working fine!

BUG FIXES
  • Cached Entity Not Found when accessed in wrappers FIXED
  • ClientVersion was unresolvable for 1.16.3 and 1.16.4 clients FIXED
  • PacketEvents failing to inject you and doesn't call any events for your player (RARE BUG) FIXED.
    This bug could only happened if you had injectEarly set to true.
  • PacketEvents' version lookup utilities now prioritizes ViaVersion, then ProtocolLib and then lastly ProtocolSupport.
    There was a bug where ProtocolSupport errored if PacketEvents used it for the protocol version lookup.
  • UpdateChecker not working FIXED
NEW FEATURES
  • PostPlayerInjectEvent created, this event is fired after the ClientVersion gets resolved.
    The event contains the client version and the netty channel object.
    The event is always called synchronously and it is recommended to register all your player data in this event.
----------, Nov 23, 2020

CHANGELOG
INFO

  • The PacketEvents.getSettings().useProtocolLibIfAvailable(boolean) setting is most likely not be coming back.
  • Recommended to have ViaVersion, ProtocolSupport or ProtocolLib on your spigot server, as PacketEvents makes use of them to resolve client version ONLY if they are available.
NEW FEATURES
  • Official 1.16.4 support
    ClientVersion.v_1_16_4, ServerVersion.v_1_16_4 created
BUG FIXES
  • Bungee client version resolving bug fixed
    One of the recommended dependencies(ViaVersion, ProtocolSupport, ProtocolLib) are only required on the spigot server if you have a bungee network.
  • Interruption of PacketEvents.stop() protected(Two plugins calling the method will no longer break PacketEvents)
----------, Nov 17, 2020

Changelog

BUG FIXES
  • Accessing Entity by ID on servers with more than one world ERROR FIX
  • Possibly cleared console error spam on player injection failures, by handling the exception and kicking the player instead.(Fix only for developers with the "earlyInject" setting disabled)
CHANGES/FEATURES
  • In the WrappedPacketOutChat(String, ChatPosition, UUID) constructor, the String(=message) shouldn't be passed in JSON string format, it can be passed in as an ordinary string message!
    Example:
Code (Text):

WrappedPacketOutChat packet = new WrappedPacketOutChat("Hello", ChatPosition.CHAT, uuid);
 
----------, Nov 16, 2020

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

Changelog
  • WrappedPacketInBlockPlace#getX,Y,Z returning -1 on 1.8 servers FIXED.
----------, Nov 9, 2020

Changelog
  • Direction enum cleaned up, unneeded enum constant values removed.
  • NullPointerException with the Player in PacketSendEvent FIXED.
  • WrappedPacketInBlockDig getX(), getY(), getZ() not working FIXED.
  • WrappedPacketInBlockDig.getDirection() optimized and now works on 1.7.10.
    FYI the direction is also known as the block face.
  • WrappedPacketInBlockPlace#getX(), getY(), getZ() not working FIXED.
  • WrappedPacketInBlockPlace#getItemStack() removed as the itemstack field doesn't exist in newer versions.
    Legacy packetevents was lazily coded and actually used a block iterator to find the block you are looking at.
    I now removed the field as we cannot have full cross version compatibility with the method.
    If you don't want to be supporting the newer versions, use my wrapper creation utilities to access it yourself.
  • WrappedPacketInBlockPlace#getDirection() added
  • WrappedPacketInUpdateSign#getX(), getY(), getZ() not working FIXED.
  • WrappedPacketInUpdateSign#getTextLines() errors FIXED.
  • WrappedPacketOutHeldItemSlot wrapper created.(Basically change player's current selected slot)
  • Incompatibility and errors with paper(1.16.x) fixed.
  • PacketEvents.getSettings().packetHandlingThreadCount(int) setting added.
    It lets you decide how many threads PacketEventsshould use when asynchronously injecting/ejecting players, processing packets(PacketEvents' end) and event calling(processing on your end).
    PacketEvents' current default settings are the most recommended settings.
    Having more than one thread doing all that processing might cause you (or PacketEvents, as that feature hasn't been tested that much) some concurrency issues where multiple threads are accessing/modifying the same data at the same time!
----------, Nov 8, 2020

Changelog

• Performance improvement when players leave
• Fixed error when you leave the server
----------, Nov 3, 2020

Changelog

• PacketSendEvent accidentally called on a server list ping resulting Player to be null, corrected to be a PacketStatusEvent
It is a good practice to check if the packet ID in the PacketReceiveEvent and PacketSendEvent isn't -1, and THEN start processing and access the player to be as error free as possible.
• WrappedPacketInVehicleMove wrapper created(packet only exists on 1.9+)
----------, Nov 2, 2020

Changelog
• Early player login bug fixed.
If you would join while the server was still starting, PacketEvents would spam errors, if you had early inject mode enabled. This has been fixed and you will be kicked and asked to rejoin in the kick reason.
----------, Nov 1, 2020

Changelog: This changelog displays all changes since the last release(1.6.9).

These changes are listed from the oldest to the most recently added features/bug fixes.

I have not had the time to test every single feature, but I am very certain that a lot of things will work.
Make sure to report bugs as soon as you find them, so they can be fixed in a patch update.

All Changes Summarized:

All deprecated methods since 1.6.9 have been cut off.
• The wrappers cache the fields efficiently for an even better performance experience. (Thanks to @Terrarier2111)
• Usage of PacketEventsSettings changed.
Doing this is now possible:
Code (Text):

PacketEvents.getSettings().injectAsync(true).ejectAsync(true).
useProtocolLibIfAvailable(true);
 
• Bug in WrappedPacketInWindowClick fixed.
• Cleaner errors, a few custom exceptions created(for example WrapperFieldNotFoundException) to help us spot bugs easier.
• WrappedPacketInArmAnimation removed as it was just a redundant wrapper, nothing to read.
• WrappedPacketOutGameStateChange "value" field accidentally returned the "reason" field.
• Finding entities by their ID optimized to use less reflection calls than necessary.
• WrappedPacketOutEntityMetadata created, for now only provides entity ID(so unfinished).
• WrappedPacketOutEntityTeleport wrapper created, performs best on 1.7-1.8.x.
Not recommended to use wrappers if it is possible with the Bukkit API as we will most likely be slower due to our reflection calls.
It is common that the required reflection calls of a field in a wrapper unfortunately increases every 3rd/4th minecraft update.
So wrappers perform best on 1.7.10 and 1.8.
• WrappedPacket now supports a nice util to write to fields.
Use this if a sendable wrapper you want to use does not exist yet.
• All wrappers optimized to only read the fields you access with its getter method.
For example, in the flying packet, if you only need access the xyz coordinates and nothing else, PacketEvents will not use reflection calls to redundantly read the other fields.
• Optimized ServerVersion enum, isHigherThan, isLowerThan.. with the ServerVersion have been optimized and are now not heavy at all, you no longer need to cache these things. (Thanks to @Terrarier2111)
• Netty channel accessing (even when cached) optimized. (Thanks to @Terrarier2111)
• Lots and lots of code cleanup. (Thanks to @Terrarier2111)
• PacketEvents now calculates player ping independently with Keep Alive packets(we don't send any ourselves).
If you would still like to access NMS' calculated ping, now use:
Code (Text):

PacketEvents.getAPI().getPlayerUtils().getNMSPing(Player);
 
The NMS ping is smoothed, so if you want a value close to NMS' calculations use:
Code (Text):

PacketEvents.getAPI().getPlayerUtils().getSmoothedPing(Player);
 
• PostPacketReceiveEvent and PostPacketSendEvent created. (Not cancellable, they events assure you the relating event wasn't cancelled)
• Update checking uses the same thread pool that is used to inject players, eject players, and process events.
• WrappedPacketOutEntity can now be sent to players.
• BungeeCord support added(Check out the Bungee version)
• Vector3i utility class created
• PacketEvents auto resolve client version setting removed as it may cause falses and is now unneeded.
• PacketEvents now has a setting to use TinyProtocol and basically inject players earlier, so you won't need a dependency to resolve client versions.
• PacketLoginEvent created
• PacketStatusEvent created
• WrappedGameProfile utility class created
• Setting to inject earlier created(Basically if TinyProtocol should be used)
TinyProtocol allegedly has bugs when users join while the server is still starting, I will double check and test.
• New Setting to activate/deactivate TinyProtocol. If ViaVersion, ProtocolSupport or ProtocolLib is found, we will use their APIs to access their already resolved client version, so we don't have to. :)
This setting is enabled by default btw.
Code (Text):

PacketEvents.getSettings().injectEarly(boolean);
 
• PacketType.Login.x and PacketType.Status.x Packet IDs created.
• All new login wrappers created:
WrappedPacketLoginDisconnect, WrappedPacketLoginHandshake, WrappedPacketLoginInCustomPayload(roughly since 1.13.2), WrappedPacketLoginInStart, WrappedPacketLoginOutEncryptionBegin, WrappedPacketLoginInEncryptionBegin, WrappedPacketLoginOutSetCompression(roughly since 1.8), WrappedPacketLoginOutSuccess
• All new status wrappers:
WrappedPacketStatusPing, WrappedPacketStatusPong
• The login and status event will only be triggered if you toggle on the early inject setting, as we need to inject early to listen to them.
• WrappedPacketOutExplosion created and can be sent to players.
• WrappedPacketOutEntityStatus created and can be sent to players.
• WrappedPacketOutExperience created and supports being sent to players.
----------, Oct 30, 2020

Changelog

• Support 1.16.3 spigot(bugs for 1.16.3 fixed)
• ClientVersion enum optimized, takes much less memory
• ClientVersion#isHigherThan(ClientVersion) and ClientVersion#isLowerThan(ClientVersion) are very cheap to call now
• ClientVersion resolving is faster
• ClientVersion.v_1_16_1 and ClientVersion.v_1_16_2 protocol version corrected (Thanks to @LIWKK)
• ClientVersion.v_1_16_3 added
• PacketEvents.getVersion() function to get the local PacketEvents version (Thanks to @NikV2)
• PacketEvents Update reporter added, that compares the local version to the latest RELEASED version
• Auto update reporting togglable with a setting
Code (Text):

boolean value = true;
PacketEvents.getAPI().getSettings().setShouldCheckForUpdates(value);
value = PacketEvents.getAPI().getSettings().shouldCheckForUpdates();
 
• Player not injecting on second join FIXED
• The netty channel cache is now functioning, we don't have to access it each time with reflection whenever we need it
• Sending packets to players should be faster as we cache the netty channel and no longer use reflection to send packets
• WrappedPacketOutCustomPayload wrapper added(supports sending to players)
• WrappedPacket fields are now cached, so reading should be faster now
----------, Sep 20, 2020

Changelog
The changelog might be small, but a lot of work has been added to each change.

• Official 1.16.3 support(not everything has been tested)
• PacketType has been moved from io.github.retrooper.packetevents.packet.PacketType to io.github.retrooper.packetevents.packettype.PacketType
• Reflection usage optimized, packet wrappers are overall faster now, memory usage should be much lower now. (Thanks to @funkemunky)
• WrappedPacketOutGameStateChange wrapper created(supports sending to players)
• WrappedPacketInUpdateSign wrapper created
• Sending packets to players has been optimized, I no longer use reflection(Suggested by @funkemunky)
• New functions appended to WrappedPacketReader interface and implemented in WrappedPacket.
Code (Text):

WrappedPacket wrapper = new WrappedPacket(object);
byte[] bArray = wrapper.readByteArray(0);
short[] sArray = wrapper.readShortArray(0);
int[] iArray = wrapper.readIntArray(0);
...
String[] strArray = wrapper.readStringArray(0);
Object[] array = wrapper.readObjectArray(0, MyClass.class);
 
• Setting to prevent PacketEvents from interacting with ProtocolLib if ProtocolLib is available added, some people experience issues with ProtocolLib.
Code (Text):

PacketEvents.getAPI().getSettings().setUseProtocolLibIfAvailable(boolean)
 
To-Do for 1.6.9-1.7?
• Update Checker in PacketEvents letting you know if a new version of PacketEvents has been released
• WrappedPacketOutCustomPayload wrapper
• WrappedPacketOutEntityMetadata wrapper
----------, Sep 16, 2020

Changelog
• Creating wrappers is much easier, cleaner and shorter.
• Thread safety issues with the new event priority system fixed(didn't let users connect to the server)
• You can make your own mini wrappers, example:

Code (Text):

@PacketHandler
public void onReceive(PacketReceiveEvent event) {
    if(event.getPacketId() == PacketType.Client.FLYING) {
        WrappedPacket miniWrapper = new WrappedPacket(event.getNMSPacket());

        double x = miniWrapper.readDouble(0);
        double y = miniWrapper.readDouble(1);
        double z = miniWrapper.readDouble(2);
        boolean onGround = miniWrapper.readBoolean(0);
    }
}
 
All current packet wrappers use these new functions ('readDouble', ect...).
So if a wrapper doesn't already exist, you can use these functions.
• Code cleanup in ALL wrappers
• WrappedPacketOutAbilities#getWalkSpeed() accidentally returned the value of WrappedPacketOutAbilities#getFlySpeed()
• WrappedPacketOutChat.fromStringToJSON() debug removed
• WrappedPacketOutKickDisconnect constructor now requires a json string, and doesn't convert for you
• WrappedPacketOutUpdateHealth#getFoodSaturation() accidentally returned the value of WrappedPacketOutUpdateHealth#getHealth()
• WrappedPacketOutEntity has subclasses, like rel entity move, ect...
• WrappedPacketInFlying subclasses no longer extend the WrappedPacketInFlying, they are now just static classes inside it, this will mean they won't contain all functions like WrappedPacketInFlying does, this was done just to avoid confusion.
----------, Sep 10, 2020

Changelog

• PacketEvents not enabling if ProtocolLib isn't present BUG FIX!
----------, Sep 9, 2020

Changelog

• Event priority system added(Passed onto ProtocolLib if ProtocolLib is present)
• PacketEvents uses ProtocolLib API to listen to packets if it is available.
This update should help making your plugins compatible with other plugins using the ProtocolLib API.
It is recommended to add 'ProtocolLib' as a soft dependency to your plugin now.

What to expect in the next update?
• Better wrapper creation API, to make creating wrappers easier, especially for the contributors.
• Cleanup code, PacketEvents might not be too clean at the moment
• Test if sending packets breaks with ProtocolLib
• Create WrappedPacketOutCustomPayload wrapper
• Create WrappedPacketOutEntityMetadata wrapper
----------, Sep 9, 2020

Changelog

For some reason the last version on SpigotMC didn't update and display as 1.6.5, so I re-released it.

• Example code removed (causing issues)

• PacketEvents.getAPI().getPlayerUtils().getClientVersion(Player) always ClientVersion.INVALID fix

• A lot more ServerVersion enum constants added

• BukkitMoveEvent deprecated and will most likely be removed

• Performance issues with PacketEvents causing players to have high ping FIXED(just make sure you have async injection setting on) - Thanks to @LIWKK for reporting and helping out a bit

• PacketEvents FULLY documented, good for the JavaDoc

• PacketEvents license and copyright notice added in each file, when distributing closed source versions of your products, make sure you don’t obfuscate my files

• Accessing server version failure fixed

• PacketEvents.start(Plugin) deprecated, use PacketEvents.init(Plugin)

• PacketType.Server packet IDs are now final(constant), you can now use them in switch statements - @undersquire

• PacketEvents API Guide is in the process of a rewrite, almost finished
----------, Sep 9, 2020

Changelog

For some reason the last version on SpigotMC didn't update and display as 1.6.5, so I re-released it.

• PacketEvents.getAPI().getPlayerUtils().getClientVersion(Player) always ClientVersion.INVALID fix

• A lot more ServerVersion enum constants added

• BukkitMoveEvent deprecated and will most likely be removed

• Performance issues with PacketEvents causing players to have high ping FIXED(just make sure you have async injection setting on) - Thanks to @LIWKK for reporting and helping out a bit

• PacketEvents FULLY documented, good for the JavaDoc

• PacketEvents license and copyright notice added in each file, when distributing closed source versions of your products, make sure you don’t obfuscate my files

• Accessing server version failure fixed

• PacketEvents.start(Plugin) deprecated, use PacketEvents.init(Plugin)

• PacketType.Server packet IDs are now final(constant), you can now use them in switch statements - @undersquire

• PacketEvents API Guide is in the process of a rewrite, almost finished
----------, Sep 5, 2020

Changelog

• PacketEvents.getAPI().getPlayerUtils().getClientVersion(Player) always ClientVersion.INVALID fix

• A lot more ServerVersion enum constants added

• BukkitMoveEvent deprecated and will most likely be removed

• Performance issues with PacketEvents causing players to have high ping FIXED(just make sure you have async injection setting on) - Thanks to @LIWKK for reporting and helping out a bit

• PacketEvents FULLY documented, good for the JavaDoc

• PacketEvents license and copyright notice added in each file, when distributing closed source versions of your products, make sure you don’t obfuscate my files

• Accessing server version failure fixed

• PacketEvents.start(Plugin) deprecated, use PacketEvents.init(Plugin)

• PacketType.Server packet IDs are now final(constant), you can now use them in switch statements - @undersquire

• PacketEvents API Guide is in the process of a rewrite, almost finished
----------, Sep 3, 2020

Changelog
• Issues with WrappedPacketInEntityAction#getAction() fixed for 1,7,10 and 1.8+
• Debug spam removed(1.6.1 JAR version had some debugs spammed in console and in game)
----------, Aug 30, 2020

Changelog
  • JavaDoc on https://retrooper.github.io/packetevents. -- Thanks to @SamJakob
  • PacketEvents.getSettings().setIdentifier(String); DEPRECATED, as it is now unneeded.Thanks to -- @NikV2
  • PacketEvents now generates a random identifier for your plugin if you don't set an identifier before calling PacketEvents.start(Plugin)
  • Nullpointer for accessing entity in many wrappers fixed
  • Setting to enable Asynchronous player uninjections(massive performance boost) which sadly does sacrifice reload support, therefore is set to false by default. Thanks to -- @NikV2
Code (Text):

public Entity getEntity();
 
  • WrappedPacketOutChat now containing a ChatPosition enum, sending the WrappedPacketOutChat should be stable but listening to it is MOST LIKELY UNSTABLE, therefore it was marked with the 'Beta' annotation
----------, Aug 28, 2020

Changelog

• All wrappers optimized
• WrappedPacketOutKeepAlive can now be sent to players
• WrappedPacketOutPosition(not all fields added yet, but usable) wrapper created
• WrappedPacketInWindowClick wrapper created
• WrappedPacketInAbilities bug fixed for 1.16.x, only #isFlying() exists on 1.16.x, the rest of the functions are now deprecated due to this.
• Useless enums deleted: Gamemode.java, Hand.java
• Enums that belong to wrappers have been refactored to be a "subclass" of that wrapper: EntityAnimationType.java, EntityUseAction.java, PlayerAction.java, PlayerDigType.java
• Null pointer fixed in WrappedPacketInCustomPayload for 1.7.10
• Null pointer fixed in WrappedPacketInBlockPlace for 1.7.10
• Bug fixed in WrappedPacketInClientCommand for 1.7.10
• WrappedPacketInEntityAction.PlayerAction missing enum constants for 1.7.10/1.8.x fixed, this enum should now be 1.7.10->1.16.2 safe, the RIDING_JUMP doesn't exist on newer versions, so accessing this enum should return START_RIDING_JUMP instead.
• PacketEvents.getAPI().getPlayerUtils().uninjectPlayerNow() REMOVED, use #uninjectPlayer(), in this build 'uninjectPlayer' is sync.(before it was async), we no longer offer async uninjecting
----------, Aug 27, 2020

Changelog
• WrappedPacketOutEntity bug fix for 1.9->1.15
• WrappedPacketOutEntity optimized
----------, Aug 24, 2020

Release 1.5.8.2

• Code cleanup
• PacketReceiveEvent#getNMSPacketClass() deprecated
• PacketReceiveEvent#getPacketName() deprecated
• PacketSendEvent#getNMSPacketClass() deprecated
• PacketSendEvent#getPacketName() deprecated
• PlayerUninjectEvent#PlayerUninjectEvent(Player player, boolean sync) deprecated, use PlayerUninjectEvent#PlayerUninjectEvent(Player player)
• WrappedPacketInBlockDig null pointers fixed for 1.7.10, just Direction field will be Direction.NULL, I will fix later
----------, Aug 19, 2020

Changelog
• v_1_16_1 and v_1_16_2 added in ClientVersion & ServerVersion
• Settings class renamed to PacketEventsSettings
• WrappedPacketInSettings wrapper created, for the client settings packet
• WrappedPacketInEntityAction code duplication fix
----------, Aug 17, 2020

Changelog

• Memory Leak fix
• Deprecated methods removed
----------, Aug 13, 2020

Changelog since 1.5.5

• WrappedPacketInEntityAction bug fix for 1.7.10
• All deprecated methods in the ServerUtils & PacketEventsAPI class removed
----------, Aug 11, 2020

Changelog since 1.5.4.2
• License updated to MIT
• Packet name is only accessed, if you call the getPacketName() method, it is recommended to compare packets with IDs
• HeldItemSlot wrapper added
• CustomPayload wrapper added
• ArmAnimation wrapper added

Special thank you to our contributors for helping me maintain this API.
----------, Jul 24, 2020

Changelog since 1.5.4(.0)
• PlayerUninjectEvent#isSync now documented
• Shutdown bugs fixed(unending shutdown)
• Player quit error fixed
• Code cleanup & Imports optimized
----------, Jul 20, 2020

Changelog:
• PlayerUninjectEvent#isSync now documented
• Shutdown bugs fixed(unending shutdown)
• Code cleanup & Imports optimized
----------, Jul 20, 2020

Changelog:
• Shutdown errors, caused by pending reloads FIXED
• Auto resolve client version setting added, it will set the client version to the server's version if the client version fails to resolve
• toProtocolVersion() added in ServerVersion

MAKE SURE YOU DON'T START AND STOP packetevents if you are using the JAR version of the API as it is already done for you.
Will cause errors.
----------, Jul 19, 2020

Changelog since 1.4.2
• All reload issues fixed
• Multiple plugins using the API can now run safely
• An Identifier must be specified in the settings
PacketEvents.getSettings().setIdentifier(“my-anticheat-name”);
The identifier MUST be set before the PacketEvents.start(this) is called!
This identifier is used to have unique handler names, another plugin having the same identifier will cause errors.
So, keep it unique!
• WrappedPacketOutKeepAlive wrapper added
• PlayerUninjectEvent#isSync added, basically telling you if the uninjection has been called asynchronously or synchronously.
The event is still called synchronously!
Players are only uninjected synchronously when the server stops/reloads.
Meaning the event is called asynchronously when they manually leave the server or have been kicked.
• PacketEvents.getAPI().getPlayerUtilities() deprecated, use getPlayerUtils()
• PacketEvents.getAPI().getServerUtilities() deprecated, please use getServerUtils()
• PacketEvents.getAPI().getPlayerUtils().uninjectPlayerNow(Player) added, calling that method will synchronously uninject the player.
----------, Jul 11, 2020

• PacketEvents.getAPI().getPlayerUtilities().getPlayerPing(player); deprecated, use getPing(player);

• ServerTickEvent deprecated and it's Bukkit task too, will be removed in the next VersionLookupUtils

• PacketEvents.getAPI().getSettings().setDefaultServerVersion(version); added
Settings the default version will let PacketEvents use the default version if PacketEvents fails to detect your server version.
No idea why this happens in a spigot fork by the name of mSpigot, but yea.
----------, Jul 6, 2020

CREDIT TO TRG for helping out
• Packets are now compared with integer IDs.
• PacketSendEvent#getPacketId() added.
• PacketTypeNames deprecated, will be removed in the next version.
• All 1.16 Packets added
----------, Jul 4, 2020

Note: ONLY TESTED ON 1.8
  • PacketReceiveEvent#getPacketId() added
  • PacketType comparing packets should no longer be done with strings, instead with int ids Example: if(PacketReceiveEvent#getPacketId() == PacketType.Client.ARM_ANIMATION)
  • Comparing with int ids only finished for client side (serverbound) packets, server side support coming soon
  • PacketEvents.load() should be called onLoad() in your main class if you are NOT using the packetevents jar and PacketEvents.start(plugin); in your onEnable function
----------, Jul 3, 2020

  • PacketTypeClasses class added for NMS Packet class comparisons
  • @PacketHandler(synchronization = EventSynchronization.x) annotation property now available.

    API has changed a lot, working on some wiki docs for it!
  • WrappedPacketInSteerVehicle packet wrapper added
----------, Jun 29, 2020

Changelog:
Fixed all errors with the WrappedPacketInEntityAction wrapper.
----------, Jun 27, 2020

PacketEvents 1.3.7
• Most clientbound wrappers tested, it is assumed the rest will work
• Official 1.16.1 Support
• All bugs from 1.3.6.2 fixed
• Wrote a custom Reflection utils, much cleaner code now with auto caching
----------, Jun 26, 2020

PLEASE USE THIS UPDATED VERSION AS IT CONTAINS A LOT OF BUG FIXES!

Expect official 1.16 support in the next update!

Changelog:

Clientbound Abilities wrapper added and is sendable to clients

• Clientbound health update wrapper added and is sendable...
  • TinyProtocol removed

  • API Size way smaller

  • PlayerUninjectEvent is now called

  • Version lookup methods re-added, but version lookup is only possible with ProtocolSupport or ViaVersion plugin avaialable on the server.
    If you try looking up version and none of the listed plugins could be found, you will result with ClientVersion.ACCESS_FAILURE

  • WrappedPacketOutAbilities sendable wrapper added

  • PostPlayerInjectEvent has been deprecated, please use PlayerInjectEvent

  • PlayerUninjectEvent now cancellable

  • PlayerInjectEvent or PlayerUninjectEvent cancelling, will cancel the action.
  • Packet class has been deprecated, please use PacketType instead!

  • Packet.isInstanceOfFlyingPacket(nmsPacket) -> PacketType.Util.isInstanceOfFlyingPacket(nmsPacket), and more instanceof functions are added in the PacketType.Util class too!

  • PacketReceiveEvent#getPacket() is deprecated, please use PacketReceiveEvent#getNMSPacket()

  • PacketSendEvent#getPacket() is deprecated, please use PacketSendEvent#getNMSPacket()

  • PacketEvents.setShouldKickOnRestart(boolean) removed
  • Issues with netty fixed
----------, Jun 26, 2020

1.3.4 RELEASE, This is probably one of my most important releases, this is the last release using TinyProtocol!

Changelog:

• Clientbound Abilities wrapper added and is sendable to clients

• Clientbound Health update wrapper added and is also sendable to clients
• BukkitMoveEvent event added, it is called whenever the bukkit event PlayerMoveEvent"

Info:
TinyProtocol helped us listen to some login and handshake packets!
But it also came with a lot of bugs and problems to deal with, even today there are still some bugs and many people using this API have complained about it.

I will now stop using TinyProtocol.

WHAT WILL THIS MEAN?

There will be lots of pro's and con's.

Pros:
• No more issues with reloading
• Smaller file size

Cons:
• Version lookup will now only be possible with dependencies like ViaVersion.
• Soft depend on via version as mentioned above. Soft depend meaning that if you want to lookup versions, ViaVersion dependency is a requirement.

• All login wrappers and the login event will be removed!

It is very important that PacketEvents is stable and users shouldn't keep running into issues, because of TinyProtocol.
I am releasing this version with TinyProtocol for the users that will miss and still want TinyProtocol.
----------, Jun 22, 2020

Version 1.3.3.1
Changelog

Release On Github
Release on Jitpack
  • Lots of code optimizations
  • Feature to kick all online players on reload or restart
  • PacketEvent.currentCalculatedMS() has been deprecated and you should now use
    PacketEvents.highlyPreciseMillis()
  • EventManager hasRegistered method renamed to isRegistered.
    Usage: PacketEvents.getEventManager().isRegistered()
----------, Jun 18, 2020

Release 1.3.3

Changelog:

• LoginInEncryptionBegin & LoginOutEncryptionBegin wrapper added,
• LoginStart & LoginStatusPing wrapper added,
• Bug fixed with PostPlayerInjectEvent not being called
• Custom GameProfile class coded,
• Main example class readded
• EventManager small optimization
• Imports optimized
----------, Jun 17, 2020

Resource Information
Author:
----------
Total Downloads: 19,225
First Release: Jun 16, 2020
Last Update: Dec 10, 2024
Category: ---------------
All-Time Rating:
49 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings