? MIDI 插件消息模组
此 Minecraft 模组通过自定义插件消息支持从客户端向服务器发送 MIDI 操作。它可用于控制游戏内乐器、音响系统、灯光效果或其他对 MIDI 作出反应的特效。
? 插件消息:midi:action
该插件消息基于名为 MidiAction 的自定义负载(payload),通过 CustomPayload 系统进行发送。
MidiAction 负载结构
record MidiAction(
String name,
int command,
int channel,
int data1,
int data2
)
| 字段 | 类型 | 描述 |
|---|---|---|
name |
String |
MIDI 设备名称(例如 "Launchpad") |
command |
int |
MIDI 命令(例如 144 = Note On / 音符开启) |
channel |
int |
MIDI 通道(0–15) |
data1 |
int |
第一个数据值(例如,音符编号) |
data2 |
int |
第二个数据值(例如,力度) |
? 使用示例
从客户端发送
ClientPlayNetworking.send(
new MidiAction("Launchpad", 144, 0, 60, 127)
);
在服务器端接收
在你的服务端模组中注册一个全局接收器:
ServerPlayNetworking.registerGlobalReceiver(
MidiAction.ID,
(payload, context) -> {
System.out.println("Received MIDI action from device: " + payload.name());
}
);
⚙️ 技术细节
- 数据包 ID:
midi:action - 编解码器: 使用
FriendlyByteBuf的自定义实现 - Minecraft 版本: 1.20.5+(使用了
CustomPacketPayloadAPI)
✅ 依赖要求
- Minecraft 1.20.5 或更高版本
- Fabric(或其他兼容的加载器)
- 能够处理传入的
MidiAction负载的服务端模组
有问题或建议?欢迎提交 issue 或直接联系我们!
? 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
下载 midi
下载 midi
下载 midi
下载 midi
下载 midi
下载 midi
下载 midi
下载 midi
下载 midi
? 更新内容:
- 更新 updateDescription.yml
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
一个用于收集生物掉落物的多区块模组。
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
查看物品与配方
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
适用于 MC 1.18+ 的 Effekseer 加载器
模组
添加区块认领和玩家组队功能,并与 Xaero's Minimap 和 World Map 集成
评论 0
登录后参与评分
还没有评论,来抢沙发吧