You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fabric API guide: Migrating to packet object-based API
Migrating to Packet Object-based Networking
Fabric API 0.77.0 for 1.19.4 and 1.20 introduced a new way of writing networking stack. This applies to ServerPlayNetworking and ClientPlayNetworking. This is a guide on migrating existing code using Networking API v1 to new, packet-based code.
If you are still using the deprecated Networking API v0, it is recommended to switch to v1 first.
When the old API should still be used
The new API makes some assumptions on the usage. While this covers most of the common and expected uses, there are cases where the old API still works better. Therefore, the old API is not deprecated in anyway. Also, the two APIs are network-compatible so long as the packet serialization is the same.
For example, you might want to continue using the old API if: