Custom payload
Sends a typed MidiAction payload through the plugin message channel.
MIDI is a Minecraft mod that forwards MIDI actions from client to server using the midi:action plugin message. It is ideal for instruments, lighting effects, or any MIDI-driven gameplay system.
record MidiAction(
String name,
int command,
int channel,
int data1,
int data2
)Client send
ClientPlayNetworking.send(
new MidiAction("Launchpad", 144, 0, 60, 127)
);Server receive
ServerPlayNetworking.registerGlobalReceiver(
MidiAction.ID,
(payload, context) -> {
System.out.println("Received MIDI action from device: " + payload.name());
}
);