User Tools

Site Tools


tutorial:networking

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
tutorial:networking [2021/09/07 20:22] – Rename ModNetworkingConstants to TutorialNetworkingConstants to clarify that it is a tutorial class, not part of Minecraft or FAPI daomephstatutorial:networking [2021/10/01 03:00] voleil
Line 105: Line 105:
  
 To receive a packet from a server on the game client, your mod needs to specify how it will handle the incoming packet. To receive a packet from a server on the game client, your mod needs to specify how it will handle the incoming packet.
-In your client entrypoint, you will register the receiver for your packet using ''PlayClientNetworking.registerGlobalReceiver(Identifier channelName, ChannelHandler channelHandler)''+In your client entrypoint, you will register the receiver for your packet using ''ClientPlayNetworking.registerGlobalReceiver(Identifier channelName, ChannelHandler channelHandler)''
  
 The ''Identifier'' should match the same Identifier you use to send the packet to the client. The ''ChannelHandler'' is the functional interface you will use to implement how the packet is handled. **Note the ''ChannelHandler'' should be the one that is a nested interface of ''ClientPlayNetworking''** The ''Identifier'' should match the same Identifier you use to send the packet to the client. The ''ChannelHandler'' is the functional interface you will use to implement how the packet is handled. **Note the ''ChannelHandler'' should be the one that is a nested interface of ''ClientPlayNetworking''**
tutorial/networking.txt · Last modified: 2024/05/04 19:51 by bluemeanial