API reference Obsidian.API.Networking
ICustomPayload<TSelf> interface
A custom payload sent over a plugin channel (a minecraft:custom_payload packet). Register it with IPluginRegistry.MapPayload and send it with IClient.SendPayloadAsync.
public interface ICustomPayload<TSelf> where TSelf : ICustomPayload<TSelf>
In Obsidian.API.
Type parameters
TSelf- The payload type itself.
Remarks
The channel and encoding are what a NeoForge mod declares for the same payload type, so an Obsidian plugin and a NeoForge client mod can talk to each other when both use the same channel id, version and field encoding.
Properties
Channel
static abstract string Channel { get; }The namespaced channel id, for example examplemod:sync.
Methods
Read(INetStreamReader)
static abstract TSelf Read(INetStreamReader reader);Reads a payload from the bytes after the channel id.
Write(INetStreamWriter)
void Write(INetStreamWriter writer);Writes this payload's fields; the channel id is written for you.