跳到正文

GBM

作者:yawaflua

This is implementation of stupid idea - What if I can use Golang to Minecraft modding?

收藏

截图

介绍

中文介绍正在准备中,下面暂时显示原文。

Go Minecraft Bridge

Go Minecraft Bridge hosts plugins written in Go in both Minecraft server and
client processes. The Minecraft-facing code stays in Java, while plugin logic
receives immutable snapshots/events and returns actions or named system calls.

The shared code is built as two version-specific Fabric artifacts:

| Minecraft | Java | Loader | Fabric API | Cloth Config | Mod Menu |
|—|—:|—:|—:|—:|—:|
| 1.21.1 | 21 | 0.16.14 | 0.116.14+1.21.1 | 15.0.140 | 11.0.3 |
| 26.1.2 | 25 | 0.19.3 | 0.149.1+26.1.2 | 26.1.154 | 18.0.0 |

Architectury Loom drives the portable 1.21.1 target, with a small source
overlay for Minecraft API differences. The unobfuscated 26.1.2 target uses
Fabric Loom because Architectury Loom currently requires a mappings artifact
that this Minecraft distribution does not publish. Architectury portability
still produces one JAR per Minecraft ABI; it does not make one universal JAR.

The current MVP also targets:

  • Go 1.24 or newer;
  • native Go plugins built with -buildmode=c-shared;
  • initialization, server/client tick, chat, death, system-call-result, and deinitialization callbacks;
  • entity snapshots and explicit subscriptions to block positions;
  • chat broadcast/direct-message actions;
  • extensible namespaced system calls;
  • capture of Go stdout, stderr, and the standard log package;
  • FlatBuffers tick snapshots (ABI v2), while control-plane messages remain JSON;
  • a Cloth Config management screen exposed through Mod Menu.

The backend interface is deliberately independent from Fabric and native FFI so
that a WASI/WASM backend can implement the same protocol later.

The server runtime is also packaged as one Paper plugin compatible with Paper
and Purpur. Its Bukkit-facing code is compiled during every build against this
API matrix:

| Server | Paper API used for verification | Java runtime |
|—|—|—:|
| Paper/Purpur 1.21.1 | 1.21.1-R0.1-SNAPSHOT | 21+ |
| Paper/Purpur 1.21.11 | 1.21.11-R0.1-SNAPSHOT | 21+ |
| Paper/Purpur 26.1 | 26.1.2.build.74-stable | 25+ |

The Paper API preserves the Bukkit surface used by the bridge, so these targets
share one Java 21 bytecode JAR. Purpur accepts it directly because Purpur is a
Paper-compatible server implementation.

Using

Visit source github to check

Roadmap

  • [ ] Adding screen render implementation
  • [ ] More systemcalls and usability
  • [ ] Event system with registration
  • [ ] All-in-one JAR file for client
  • [ ] Maybe some more…

Code is licenced under MIT Licence.

常见问题

GBM 支持哪些 Minecraft 版本?

GBM 支持 Minecraft Java 版 1.21–26.1.2,共 15 个版本,可用的加载器:Bukkit / Fabric / Paper / Purpur / Quilt。下载时注意选择和你游戏版本一致的文件。

GBM 怎么安装?

先用 PCL2 或 HMCL 启动器安装对应版本的 Bukkit / Fabric / Paper / Purpur / Quilt,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。运行环境:客户端 / 服务端。

评论

登录后评论和评分

yawaflua 的其他作品

查看全部 →