Jsonate
Jsonate simplifies Minecraft mod configuration with a lightweight JSON API, automating versioning, file handling, and type-safe data access for Forge developers.
介绍
Jsonate – Evil Json dominates everything.
Jsonate provides an intuitive, lightweight API for managing JSON-based configuration files in your Minecraft mods. Designed for simplicity and efficiency, it handles versioning, automatic file creation, and data type conversions seamlessly.
Don’t wanna add dependency? Just copy the JsonConfig class and paste it into your template!
🛠 Usage Example
Add settings to your mod with clean, readable code:
public class ExampleMod {
private static final JsonConfig CONFIG = JsonConfig.create("your_mod_id", "1.0.0")
.put("Difficulty", 3)
.put("EnableFeatures", true)
.put("BlockList", Arrays.asList("dirt", "sand"))
.initialize(); // Creates/loads JSON file
// Access values statically
public static int DIFFICULTY = CONFIG.getInt("Difficulty");
public static boolean FEATURES_ENABLED = CONFIG.getBoolean("EnableFeatures");
public static List<String> BLOCKED_ITEMS = CONFIG.getList("BlockList", String.class);
}
Generated JSON (your_mod_id.json):
{
"Version": "1.0.0",
"Difficulty": 3,
"EnableFeatures": true,
"BlockList": ["dirt", "sand"]
}
⚠ Important Notes
Cache Config Values: For performance, store retrieved values in static fields (avoid repeated lookups).
Path Conventions: Files are saved to .minecraft/config/your_mod_id.json by default.
Version Control: Update the version number after changing .put logic.
常见问题
Jsonate 支持哪些 Minecraft 版本?
Jsonate 支持 Minecraft Java 版 1.16.5–1.21.8,共 25 个版本,可用的加载器:Forge / NeoForge。下载时注意选择和你游戏版本一致的文件。
Jsonate 怎么安装?
先用 PCL2 或 HMCL 启动器安装对应版本的 Forge / NeoForge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。
_nArUTo_ 的其他作品
查看全部 →Redirector [Modern]
重定向代码中 Enum#values() 的内存分配,提升游戏性能。
Dimensional Sync Fixes
修复玩家切换维度时药水/经验同步问题。
Sparse Structures Reforged
让所有结构分布得更分散(本质上就是让它们更稀有),使探索更具挑战性、减少重复感。
DespawnTweaker
更好的 Let Me Despawn 优化 | 不允许刷怪笼生成的生物消失
评论
登录后评论和评分