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.
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: