registerGlobalReceiver

static boolean registerGlobalReceiver(Identifier channelName, ServerPlayNetworking.PlayChannelHandler channelHandler)

Registers a handler to a channel.A global receiver is registered to all connections, in the present and future.

If a handler is already registered to the {@code channel}, this method will return {@code false}, and no change will be made.Use unregisterReceiver to unregister the existing handler.

Return

false if a handler is already registered to the channel

See also

net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking

ServerPlayNetworking#registerReceiver(ServerPlayNetworkHandler, Identifier, PlayChannelHandler)

Parameters

channelName

the id of the channel

channelHandler

the handler

Sources

jvm source
Link copied to clipboard