
NightBeam 模组背后的公共库
Jauml (Just Another Utility Minecraft Library) 包含了我们多个模组共享的代码:带注释的类型化 JSON 配置文件、带有 tick 调度器的服务器事件,以及面向 Fabric、NeoForge 和 Forge 的统一平台 API。
正在游玩? 如果某个模组要求安装 Jauml,请将对应加载器和 Minecraft 版本的 jar 文件放入你的 mods 文件夹中。它本身不会为游戏添加任何内容。
3.0 版本适用于 Fabric、NeoForge 和 Forge,支持 1.20.1、1.21.1、26.2 和 26.3。基于 Jauml 2.x 构建的模组仍可正常运行。



将设置项写为一个普通的 Java 类,并通过 JaumlConfig.bind("my_mod", "common", MyConfig.class) 进行绑定。
- 文件中的注释。
@Comment文本、@Range范围限制、允许的枚举值和默认值会以//开头的行写在每个选项上方。玩家也可以添加自己的注释;文件仍能正常加载。 - 安全加载。 缺失的选项会使用默认值,类型错误的值会被转换或重置,超出范围的数值会被钳制(clamp),并在日志中发出警告。
- 嵌套结构。 支持来自嵌套类的嵌套部分,以及列表和映射。玩家删除的映射条目将保持删除状态。
- 实时更新。 提供
reload()、reloadIfChanged()、update(...)和变更监听器。运行期间损坏的文件会保留上一组有效值;启动前损坏的文件会被移至.bak并重设为默认值。 - 迁移机制。 在绑定之前执行迁移逻辑,因此重命名或移动的选项会正确继承。


ServerEvents: 包括服务器启动、已启动、停止中、已停止、tick 开始和 tick 结束事件,适用于专用服务器和单人游戏服务器。ServerEvents.currentServer()返回当前运行的服务器实例。PlayerEvents: 玩家加入和离开事件。Scheduler:runLater、runRepeating和queueServerWork(即 MCreator 工作队列,含义相同),始终在服务端线程上执行。当服务器停止时,待处理的任务会被丢弃。- 单个监听器即可兼容 Fabric、NeoForge 和 Forge。启动服务器时使用
-Djauml.selfTest=true可在日志中查看所有事件;上方的卡片展示了 NeoForge 26.3 启动时的日志示例。


Services.load(IMyHelper.class)可加载你针对特定加载器实现的服务类,从而允许你从模组中删除多加载器版本的Services类副本。Platform: 提供加载器类型、物理客户端或专用服务器标识、开发环境信息、游戏目录与配置目录路径、Minecraft 版本号,以及任何已加载模组的版本和名称。- 感知版本的集成:
Platform.isModLoaded("geckolib", ">=4.4")和Platform.isMinecraft(">=26.2")。


2.x 的配置 API 全部保留在此处:
ConfigFile通过JaumlConfig.open(...)提供:类型安全的 getter、点路径访问(如server.port或users[0].name)、列表支持、原子保存、更改时重载以及损坏文件的备份功能。JsonSchema用于类型、范围、枚举、长度和必填键的检查,JsonMigrator用于版本升级迁移,JsonLib用于安全解析、深度合并、标准化和稳定输出。JaumlConfigLib是旧版模组调用的静态辅助方法集合,保留了整个 3.x 系列的所有方法和签名。


Cooldowns: 支持按玩家(或任意对象)计算的冷却时间,基于真实世界时钟时间或服务器 tick 数。Version和VersionRange: 支持比较1.20.1、26.3.0.95-beta或0.165.0+26.3,并检查以[2.1,3)、>=2.1 <3、~2.3、^2、1.x或a || b等形式编写的版本范围。Event: 一个小型监听器列表,支持为你自定义的事件设置优先级。


| Minecraft | Loaders | Java | 还需安装 |
|---|---|---|---|
| 1.20.1 | Fabric, Forge | 17 | Fabric API (Fabric, 推荐) |
| 1.21.1 | Fabric, NeoForge | 21 | Fabric API (Fabric, 推荐) |
| 26.2 · 26.3 | Fabric, NeoForge | 25 | Fabric API (Fabric, 推荐) |
- 下载与你的加载器和 Minecraft 版本匹配的文件,例如
jauml-fabric-26.3-3.0.0.jar。 - 将其安装在需要它的模组所在的目录:客户端、服务器或两者皆可。
- 在 Fabric 上,配置文件无需 Fabric API 即可工作;服务器事件和调度器需要 Fabric API,若缺失 Jauml 会记录警告。1.20.1 的 Fabric 需要 Fabric Loader 0.16.10 或更高版本。
- 从 2.x 更新: 替换旧的 jar 文件即可。你的配置文件及依赖它们的模组将继续正常工作。
- Minecraft 1.21.11 或 26.1.2? 请继续使用 Jauml 2.3.1;3.0 未针对这些版本构建。

Jauml 托管在 Modrinth Maven 上。请使用「版本」选项卡中显示的版本号,该版本号以你的加载器名称和 Minecraft 版本号结尾:
repositories {
maven { url = "https://api.modrinth.com/maven" }
}
dependencies {
// Fabric 1.20.1 / 1.21.1 以及 Forge 1.20.1 的 remap 模组 jar 包:
modImplementation "maven.modrinth:jauml:3.0.0+fabric-1.21.1"
// NeoForge,以及 26.x 版本的 Fabric(未混淆):
implementation "maven.modrinth:jauml:3.0.0+neoforge-26.3"
}
然后在 fabric.mod.json("jauml": ">=3.0.0")或 neoforge.mods.toml / mods.toml(versionRange = "[3.0.0,)")中声明它。迁移指南 提供了每个 API 的详细示例。

Jauml 会独立运行吗? 不会。它是一个库:仅在开发环境中加载、写入一个小型演示配置文件,并等待使用它的模组。
服务端和客户端都需要安装它吗? 在安装依赖它的模组的位置安装即可。Jauml 本身不会通过网络发送任何数据。
我为 Jauml 2.x 构建的模组还能正常工作吗? 可以。3.0 版没有移除 2.x 版的任何内容,也没有改变任何签名;构建过程中的一项测试会锁定所有已发布模组调用的方法。
配置文件在哪里?
在你的 config 文件夹下,位于各个模组选择的子文件夹中,例如 config/my_mod/common.json。
文档在哪里? 源码与说明 · 迁移指南 · 更新日志 · 路线图 · 问题反馈
我可以联系你吗? Discord · YouTube · Modrinth 上的更多 NightBeam 模组 和 CurseForge · 支持我们
Jauml 采用 Apache-2.0 许可证授权。由 NightBeam Studio 制作。

The common library behind NightBeam mods
Jauml (Just Another Utility Minecraft Library) holds the code our mods share: typed JSON configs with comments, server events with a tick scheduler, and one platform API for Fabric, NeoForge and Forge.
Playing? If a mod asks for Jauml, put the jar for your loader and Minecraft version in your mods folder. It adds nothing to the game by itself.
3.0 is available for Fabric, NeoForge and Forge on 1.20.1, 1.21.1, 26.2 and 26.3. Mods built for Jauml 2.x keep working on it.



Write your settings as a plain Java class and bind it with JaumlConfig.bind("my_mod", "common", MyConfig.class).
- Comments in the file.
@Commenttext,@Rangebounds, allowed enum values and defaults are written as//lines above each option. Players can add their own comments too; the file still loads. - Safe loading. Missing options get their defaults, values of the wrong type are converted or reset, and numbers outside their range are clamped, each with a warning in the log.
- Nested sections from nested classes, plus lists and maps. Map entries a player removes stay removed.
- Live updates.
reload(),reloadIfChanged(),update(...)and change listeners. A file that breaks while the game runs keeps the last good values; one that breaks before startup is moved to.bakand replaced with defaults. - Migrations run before binding, so renamed or moved options carry over.


ServerEvents: starting, started, stopping, stopped, tick start and tick end, for dedicated and singleplayer servers.ServerEvents.currentServer()returns the running server.PlayerEvents: join and leave.Scheduler:runLater,runRepeatingandqueueServerWork(the MCreator work queue, same meaning), always on the server thread. Pending tasks are dropped when the server stops.- One listener works on Fabric, NeoForge and Forge. Start a server with
-Djauml.selfTest=trueto see every event in the log; the card above shows that log from a NeoForge 26.3 boot.


Services.load(IMyHelper.class)loads your own loader-specific implementations, so you can delete the copy of the MultiLoaderServicesclass from your mod.Platform: the loader, physical client or dedicated server, development environment, game and config directories, the Minecraft version, and the version and name of any loaded mod.- Version-aware integrations:
Platform.isModLoaded("geckolib", ">=4.4")andPlatform.isMinecraft(">=26.2").


The 2.x config API is all still here:
ConfigFileviaJaumlConfig.open(...): typed getters, dot paths such asserver.portorusers[0].name, lists, atomic saves, reload on change and backups of broken files.JsonSchemafor type, range, enum, length and required-key checks,JsonMigratorfor versioned upgrades, andJsonLibfor safe parsing, deep merge, normalization and stable output.JaumlConfigLib, the static helpers older mods call, keeps every method and signature for the whole 3.x line.


Cooldowns: per-player (or per-anything) cooldowns on wall-clock time or server ticks.VersionandVersionRange: compare1.20.1,26.3.0.95-betaor0.165.0+26.3, and check ranges written as[2.1,3),>=2.1 <3,~2.3,^2,1.xora || b.Event: a small listener list with priorities for your own events.


| Minecraft | Loaders | Java | Also install |
|---|---|---|---|
| 1.20.1 | Fabric, Forge | 17 | Fabric API (Fabric, recommended) |
| 1.21.1 | Fabric, NeoForge | 21 | Fabric API (Fabric, recommended) |
| 26.2 · 26.3 | Fabric, NeoForge | 25 | Fabric API (Fabric, recommended) |
- Download the file that matches your loader and Minecraft version, for example
jauml-fabric-26.3-3.0.0.jar. - Install it wherever the mod that needs it is installed: client, server or both.
- On Fabric, configs work without Fabric API; server events and the scheduler need it, and Jauml logs a warning when it is missing. Fabric on 1.20.1 needs Fabric Loader 0.16.10 or newer.
- Updating from 2.x: replace the old jar. Your config files and the mods that use them carry on as before.
- Minecraft 1.21.11 or 26.1.2? Keep Jauml 2.3.1; 3.0 is not built for those versions.

Jauml is on the Modrinth Maven. Use the version number shown on the Versions tab, which ends in your loader and Minecraft version:
repositories {
maven { url = "https://api.modrinth.com/maven" }
}
dependencies {
// Fabric 1.20.1 / 1.21.1 and Forge 1.20.1 remap mod jars:
modImplementation "maven.modrinth:jauml:3.0.0+fabric-1.21.1"
// NeoForge, and Fabric on 26.x (unobfuscated):
implementation "maven.modrinth:jauml:3.0.0+neoforge-26.3"
}
Then declare it in fabric.mod.json ("jauml": ">=3.0.0") or neoforge.mods.toml / mods.toml (versionRange = "[3.0.0,)"). The migration guide walks through every API with examples.

Does Jauml do anything on its own? No. It is a library: it loads, writes one small demo config in development environments only, and waits for mods that use it.
Do I need it on the server and the client? Install it wherever the mod that requires it is installed. Jauml itself sends nothing over the network.
Will my mods that were built for Jauml 2.x still work? Yes. 3.0 removes nothing from 2.x and changes no signature; a test in the build pins every method released mods call.
Where are the configs?
In your config folder, under the folder each mod chose, for example config/my_mod/common.json.
Where are the docs? Source and README · Migration guide · Changelog · Roadmap · Issues
Where can I talk to you? Discord · YouTube · More NightBeam mods on Modrinth and CurseForge · Support us
Jauml is licensed under Apache-2.0. Made by NightBeam Studio.
下载 Jauml
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Jauml
下载 Jauml
下载 Jauml
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Jauml
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Jauml
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Jauml
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Jauml
下载 Jauml
下载 Jauml
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
[3.0.0] - 2026-10-23
JAUML 从 JSON 配置库扩展为 NightBeam 模组的通用库。所有 2.x API 均保持签名不变;基于 2.x 构建的模组仍可正常运行。
Added
- 类型化配置 (
tn.naizo.jauml.config):JaumlConfig.bind(subdir, name, MyConfig.class)将普通 Java 类绑定到 JSON 文件。@Comment文本和@Range边界会作为//注释行写入,读取时接受注释,缺失的键使用默认值,错误类型会被强制转换,超出范围的值会被钳制,并支持变更监听器、update、reload/reloadIfChanged以及JsonMigrator迁移。 - 平台外观层 (
tn.naizo.jauml.platform):Platform(加载器、物理端、游戏目录和配置目录、Minecraft 版本、带有范围检查的模组版本)以及用于加载模组自身META-INF/services实现的Services.load。取代了各模组 MultiLoader 的Services/IPlatformHelper副本。 - 服务器事件与调度器 (
tn.naizo.jauml.server):ServerEvents(启动中、已启动、停止中、已停止、刻开始/结束、currentServer())、PlayerEvents(加入、离开)和Scheduler(runLater、runRepeating、queueServerWork),由 Fabric API、NeoForge 和 Forge 事件触发。 Event<T>(tn.naizo.jauml.event):一个小型优先监听器列表,供模组自定义事件使用。- 实用工具:
Version/VersionRange(Maven 范围、比较器、~/^、通配符)和Cooldowns(任意时钟上的每键冷却)。 PlatformProvider默认方法:getGameDirectory、isPhysicalClient、getModVersion、getModName、getLoadedModIds、getMinecraftVersion。- 根 Gradle 构建(
./gradlew buildAll、testAll、cleanAll、syncVersion -PmodVersion=x.y.z)以及测试并构建每个工作区的 CI 工作流。 -Djauml.selfTest=true启动检查,记录每个服务器事件和一次调度器运行,并在 26.x 加载器模块及 1.20.1 Forge 中使用 GameTest 服务器运行(runGameTestServer、runGametest)以绕过 EULA 提示。
Changed
- 支持的 Minecraft 版本:1.20.1、1.21.1、26.2 和 26.3。 移除了 1.21.11 和 26.1.2 的工作区。
- 每个 jar 仅声明其自身的 Minecraft 版本(例如
[26.2,26.3)、[26.3,26.4),而非[26.x,27))。 - 在 Fabric 上,JAUML 推荐使用 Fabric API;若无 Fabric API,配置仍可正常工作,服务器事件将保持空闲并附带警告。
- Fabric 1.20.1 现在需要 Fabric Loader 0.16.10 或更高版本(当前 Fabric API 0.92.12 的最低要求)。
JaumlConfig.isCompatible接受 2.x 要求(API_BASELINE_MAJOR = 2)。JaumlConfigLib仍标记为弃用,但不再标记为即将移除;其签名由测试固定。Constants.MOD_VERSION读取JaumlConfig.LIBRARY_VERSION,若其与gradle.properties不一致则测试失败。- 平台提供程序仅加载一次并共享(
PlatformUtil、JaumlInitializer和JaumlConfig不再各自扫描ServiceLoader)。 - 加载器入口点不再输出模板化的 "Hello world" 消息。
- 工具链:Gradle 9.8.1 下的 26.2 和 26.3,Fabric Loom 1.19.3 和 ModDevGradle 2.0.148;Fabric API 0.165.0+26.3 / 0.161.0+26.2 / 0.116.17+1.21.1 / 0.92.12+1.20.1;NeoForge 26.3.0.95(稳定版)/ 26.2.0.93 / 21.1.264;Forge 47.4.28;1.21.1 的 Parchment 2024.11.17;1.21.1 的 Fabric Loom 1.10.5。
Removed
- Minecraft 1.21.11 和 26.1.2 的构建(在这些版本上使用 JAUML 2.3.1)。
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
缓冲的原始输入和线程化的事件轮询
模组
可定制的鞘翅模组,支持装饰纹饰、旗帜图案等更多功能!
模组
一个用于收集生物掉落物的多区块模组。
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
原版世界生成优化模组
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
评论 0
登录后参与评分
还没有评论,来抢沙发吧