Communication between spongeforge and forge mod client

How to send packet from spongeforge to forge(client) mod?
How to send packet from forge(client) to spongeforge mod?
In Bukkit, commonly i use ‘‘Player.sendPluginMessage(channel,byteArray)’’ send Message .
listen ''onPluginMessageReceived" method for receive message.
How to do that in spongeforge?

can anyone help me ?

In Sponge channels must be explicitly registered first via the ChannelRegistrar. Call createRawChannel to register it, and then you can call the methods sendTo and addListener on that channel.

Generally people monitor help sections for new threads. Therefore, a ‘bump’ post will do nothing except slightly annoy. In the future I would recommend not doing that unless it has been multiple days.

2 Likes

Thank you ,I noticed ChannelRegistrar is a Interface that i can’t call createRawChannel method.
Do i need to implement ChannelRegistrar ?

Sponge.getChannelRegistrar()

1 Like

thank you ,love you ~