Reputation: 11
I'm working with Minecraft Fabric 1.21.1 and I need to send data from the client to the server. Could anyone provide guidance on the correct way to accomplish this? I understand that I need to use Fabric's networking system, but I am unsure of the exact method or approach.
Specifically, I'm looking for:
I would appreciate any advice or references to documentation or examples.
Thank you!
I attempted to use ClientPlayNetworking.send() with a CustomPayload in Minecraft Fabric 1.21.1 to send data from the client to the server. I created a PacketByteBuf to hold the data and tried sending it using ClientPlayNetworking.send() with an Identifier and the buffer. However, I encountered errors related to type mismatches and the creation of CustomPayload.
Upvotes: 1
Views: 495
Reputation: 435
FabricMC posted an official blog Fabric for Minecraft 1.20.5 & 1.20.6. In the blog, FabricMC announced that there are some changes. And you can also find the documentation here, it works for all the game versions after 1.20.5.
Upvotes: 0