Skip to content

How to send data to the client at login and how to receive it on the client #1993

Discussion options

You must be logged in to vote

The code you have above doesn't look correct.
MinecraftClient is only available on the client so that method wouldn't work on a dedicated server.

Here's an example from the testsuite using the fabric api:
https://github.com/FabricMC/fabric/tree/1.18.2/fabric-networking-api-v1/src/testmod/java/net/fabricmc/fabric/test/networking/login
This is just a simple test where the server sends a dummy message to client which responds with a dummy message.

The full api is here:
https://github.com/FabricMC/fabric/tree/1.18.2/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/api
with the wiki here:
https://fabricmc.net/wiki/tutorial:networking

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@guoguo909
Comment options

Answer selected by guoguo909
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants