midi
A lightweight Minecraft mod for sending MIDI-like actions from the client to the server via custom plugin messages.
截图
介绍
🎹 MIDI Plugin Message Mod
This Minecraft mod adds support for sending MIDI actions from the client to the server using custom plugin messages. It can be used to control in-game instruments, sound systems, lighting effects, or other MIDI-reactive features.
📦 Plugin Message: midi:action
The plugin message is based on a custom payload called MidiAction, sent via the CustomPayload system.
MidiAction Payload Structure
record MidiAction(
String name,
int command,
int channel,
int data1,
int data2
)
| Field | Type | Description |
| ——— | ——– | ——————————————- |
| name | String | Name of the MIDI device (e.g., “Launchpad”) |
| command | int | MIDI command (e.g., 144 = Note On) |
| channel | int | MIDI channel (0–15) |
| data1 | int | First data value (e.g., note number) |
| data2 | int | Second data value (e.g., velocity) |
🛠 Example Usage
Sending from the Client
ClientPlayNetworking.send(
new MidiAction("Launchpad", 144, 0, 60, 127)
);
Receiving on the Server
Register a global receiver in your server mod:
ServerPlayNetworking.registerGlobalReceiver(
MidiAction.ID,
(payload, context) -> {
System.out.println("Received MIDI action from device: " + payload.name());
}
);
⚙️ Technical Details
- Packet ID:
midi:action - Codec: Custom implementation using
FriendlyByteBuf - Minecraft Version: 1.20.5+ (uses
CustomPacketPayloadAPI)
✅ Requirements
- Minecraft 1.20.5 or higher
- Fabric (or another compatible mod loader)
- A server mod that handles incoming
MidiActionpayloads
Got questions or suggestions? Feel free to open an issue or reach out
directly!
常见问题
midi 支持哪些 Minecraft 版本?
midi 支持 Minecraft Java 版 1.20.5–1.21.8,共 11 个版本,可用的加载器:Fabric。下载时注意选择和你游戏版本一致的文件。
midi 怎么安装?
先用 PCL2 或 HMCL 启动器安装对应版本的 Fabric,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。运行环境:仅客户端。
评论
登录后评论和评分