截图
介绍
Vellum is a small web engine inside Minecraft. Screens, inventories, HUD and map can be expressed as HTML page, and Vellum lays it out, animates it, runs its scripts and draws it with the normal GUI renderer.
You don’t need to install this on its own. It’s a library: mods that use it list it as a dependency, and launchers install it with them, or bundle it.
The inspiration for Vellum was three-fold:
- I’m a web developer and my Minecraft GUIs have always looked bad
- LLMs are better at web development than Minecraft GUI development
- Updating GUIs across Minecraft versions has always been a pain. With Vellum, your GUIs stay the same and just the library needs to be updated.
Vellum helps in all three cases.
What you get
- Most of CSS: block, inline, flexbox, grid and positioning, plus transitions and @keyframes. It’s a 90-10 solution, not a browser.
- The game’s own look by default. Buttons, text fields, panels, slots and tooltips use vanilla sprites and the game font, so an unstyled page already fits in.
- Vanilla mechanics where helpful. Put <slot index=”0″> wherever you want a slot and it will Just Work(tm) as expected
- Minecraft specific elements: <item>, <slot>, 3D <scene>, <entity> and <model>, sprites, and translations.
- JavaScript with Vue-style templates (v-for, v-if, v-model, @click).
- HUD overlays, Create-like Ponder scene creation, narration/accessibility support, and a standalone previewer with hot reload, so you (or your agent) can build a page without launching the game.
For mod developers
<div class="mc-panel chest">
<div class="mc-label">{{ title }}</div>
<div class="grid"><slot v-for="i in 27" :index="i - 1"></slot></div></div><style>
.grid { display: grid; grid-template-columns: repeat(9, 18px); }</style>
VellumScreens.registerContainer(MyMenus.CHEST, "mymod:vellum/chest.html");VellumScreens.open("mymod:vellum/journal.html", data).driver()
.onMessage("save", value -> Journal.save(value.getAsJsonObject()));
It’s available from maven.maxleiter.com. Feel free to mark it as a dependency or bundle it with your mod, but bundling is not recommended due to Vellum becoming outdated.
Docs: API, scripting, porting an existing screen.
Servers
A server mod can open a page on a player’s client, push data to it and get messages back. Since a server might be hostile, scripts run in a sandbox with no Java access, no network access, no file access, and sensible resource caps. Players can always close a page with Shift+Esc or block server pages entirely.
LLMs were used in the development of Vellum.
Vellum is MIT licensed. It bundles Mozilla Rhino (MPL-2.0) with a few patches, which are in the repo under rhino/patches/.
常见问题
Vellum GUI 支持哪些 Minecraft 版本?
Vellum GUI 支持 Minecraft Java 版 1.21.1–26.3,共 3 个版本,可用的加载器:Fabric / NeoForge。下载时注意选择和你游戏版本一致的文件。
Vellum GUI 怎么安装?
先用 PCL2 或 HMCL 启动器安装对应版本的 Fabric / NeoForge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。
评论
登录后评论和评分