MCDanmaku
MCDanmaku 是一款适用于 Minecraft 的 Fabric 客户端模组。它会在游戏聊天栏中显示来自指定 Bilibili 直播间的实时弹幕消息。
使用方法
登录 Bilibili
/danmaku login
登录流程:
- 模组请求一个 Bilibili 二维码登录会话;
- 在你的机器上启动一个临时的本地 HTTP 服务器;
- 聊天栏会显示一个
http://127.0.0.1:<port>/ 链接;
- 点击该链接或手动将其复制到浏览器中打开;
- 使用 Bilibili 手机 App 扫描页面上的二维码;
- 在手机端确认登录;
- 登录成功后,Cookie 将被保存到本地配置目录中。
检查登录状态
/danmaku loginstatus
退出 Bilibili 登录
/danmaku logout
这将移除本地保存的 Bilibili 登录信息。
设置直播间
/danmaku set <roomId>
如果弹幕客户端已经在运行,新的房间 ID 不会立即生效。你需要先停止客户端,然后重新启动。
开始接收弹幕
/danmaku start
启动后,当前配置的直播间的弹幕消息将显示在游戏聊天窗口中。
停止接收弹幕
/danmaku stop
停止后,当前的 WebSocket 连接将会关闭,旧连接产生的过期消息将被丢弃。
检查状态
/danmaku status
显示当前弹幕客户端的状态及房间 ID。
调试日志
默认情况下,详细的弹幕解析日志、认证响应和统计数据不会被打印出来。
要启用调试日志,请在启动 Minecraft 时添加以下 JVM 参数:
-Dmcdanmaku.debug=true
注意事项
- Bilibili 直播弹幕 API 和登录流程可能会发生变化,导致兼容性破坏;
- 登录信息仅用于请求 Bilibili 弹幕及用户相关数据;
- 请勿公开分享
bilibili-auth.properties 或任何包含 Cookie 的文件;
- 如果直播间离线或 Bilibili WebSocket 节点不可用,可能无法接收弹幕消息。
MCDanmaku
MCDanmaku is a Fabric client-side mod for Minecraft. It displays real-time danmaku messages from a specified Bilibili live room in the in-game chat.
Usage
Log in to Bilibili
/danmaku login
Login flow:
- The mod requests a Bilibili QR login session;
- A temporary local HTTP server is started on your machine;
- A
http://127.0.0.1:<port>/ link is shown in the chat;
- Click the link or manually copy it into your browser;
- Scan the QR code on the page with the Bilibili mobile app;
- Confirm the login on your phone;
- After a successful login, the cookie will be saved to the local config directory.
Check login status
/danmaku loginstatus
Log out from Bilibili
/danmaku logout
This removes the locally saved Bilibili login information.
Set live room
/danmaku set <roomId>
If the danmaku client is already running, the new room ID will not take effect immediately. You need to stop and start the client again.
Start receiving danmaku
/danmaku start
After starting, danmaku messages from the currently configured live room will be displayed in the in-game chat.
Stop receiving danmaku
/danmaku stop
After stopping, the current WebSocket connection will be closed, and stale messages from old connections will be discarded.
Check status
/danmaku status
Shows the current danmaku client status and room ID.
Debug Logs
By default, detailed danmaku parsing logs, authentication responses, and statistics are not printed.
To enable debug logs, add the following JVM argument when launching Minecraft:
-Dmcdanmaku.debug=true
Notes
- Bilibili live danmaku APIs and login flows may change and break compatibility;
- Login information is only used to request Bilibili danmaku and user-related data;
- Do not publicly share
bilibili-auth.properties or any file containing cookies;
- If the live room is offline or the Bilibili WebSocket node is unavailable, danmaku messages may not be received.
评论 0
登录后参与评分
还没有评论,来抢沙发吧