跳到正文

BSCM

作者:RegularBen

Ben's S#### Config Mod - A simple config mod meant to work easily on both server & client side.

收藏

介绍

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

BSCM (Ben’s S#### Config Mod)

BSCM is a lightweight, YAML configuration library for Fabric mods. It simplifies config creation, loading, and editing, so you can focus on building features instead of boilerplate.

Features

  • Annotation-based configs

Define your config structure directly in code with simple annotations.

  • YAML-backed

Human-readable, clean, and widely supported configuration format.

  • Automatic loading & saving No need to manually change config YAML (server-side still requires), BSCM does it all for you.

Built-in config screen (Mod Menu support) Easily edit in-game configs with Mod Menu.

  • Minimal & developer-friendly

Designed to stay out of your way while giving you full control.

Usage

  1. Create a config class
  1. Annotate fields you want to expose
  1. Let BSCM handle the rest

Example:

Gradle:

repositories{

  maven {

    name = "Modrinth"

    url = "https://api.modrinth.com/maven"
  }
  maven {
    name = "Terraformers"
    url = "https://maven.terraformersmc.com/"
  }
}
dependencies {

  modImplementation "maven.modrinth:bscm:1.0.4"
  modImplementation "com.terraformersmc:modmenu:${project.modmenu_version}"

}

Config Class:

public class ExampleConfig {

@Comment("Enable the feature")
public boolean enabled = true:

@Comment("Maximum value")
public int maxValue = 10;
}

Main Class:


import ca.techgarage.bscm.Bscm;

public void onInitialize() {

Bscm.load(ExampleConfig.class, "ModID");
}

How to set up client-side

To set up you must depend on ModMenu for the version you are using

ModMenu Integration class

public class MyModMenuIntegration extends BSCMModMenuIntegration {
    public MyModMenuIntegration() {
        super(ExampleConfig.class, "ModID");
    }
}

In your fabric.mod.json

"entrypoints": {
    "modmenu": [
        "com.example.mymod.MyModMenuIntegration"
    ]
}

BSCM will automatically:

  • Generate a YAML file
  • Load values on startup
  • Save changes when updated

In-Game Configuration

If you have Mod Menu) installed, BSCM provides a simple config GUI so users can edit settings without leaving the game.

Dependencies

  • Fabric Loader ≥ 0.15.0
  • (Optional) Mod Menu for in-game config UI

Why BSCM?

Most config systems are either:

Too complex

Too limited

Or require tons of boilerplate

BSCM aims to hit the sweet spot:

Simple, readable, and powerful enough for real mods.

常见问题

BSCM 支持哪些 Minecraft 版本?

BSCM 支持 Minecraft Java 版 1.21.11–26.1.2,共 4 个版本,可用的加载器:Fabric。下载时注意选择和你游戏版本一致的文件。

BSCM 怎么安装?

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

评论

登录后评论和评分

RegularBen 的其他作品

查看全部 →