Description
โ Starshadow Config
Beautiful config screens from plain Java classes.
Starshadow Config is an annotation-driven configuration library for Fabric mods. Define your settings as a simple Java class, annotate the fields, and get a polished config screen โ complete with tabs, sections, sliders, toggles, and enum dropdowns โ with zero boilerplate UI code.
"Config screens shouldn't require a PhD in GUI programming."
๐ช How It Works
For Mod Developers
- Add the dependency to your
build.gradle.kts - Create a config class with annotated fields
- Done โ Starshadow Config generates the entire screen
@StarConfig(modId = "mymod")
public class MyConfig {
@Tab(id = "general", icon = "minecraft:crafting_table")
@Section("scanning")
@Range(min = 1, max = 64)
@DefaultValue("16")
private int scanRange = 16;
@Section("display")
@DefaultValue("true")
private boolean showOverlay = true;
}
That's it. No screen builder class. No widget positioning. No layout math. Just your config fields with annotations.
For Players
If a mod uses Starshadow Config, you get:
- A tabbed settings screen accessible via Mod Menu
- Clean, consistent UI across all mods that use the library
- Sliders, toggles, and dropdowns instead of raw text fields
- Reset buttons to restore defaults
โจ Features
๐ Annotation-Driven API
Annotate your config POJO and the screen builds itself:
@StarConfigโ marks the class as a config@Tabโ groups fields into tabs with icons@Sectionโ organizes fields into labeled sections@Rangeโ sets min/max for numeric fields@DefaultValueโ defines the default value@EnabledWhenโ conditionally enables fields based on other values@Hiddenโ excludes fields from the generated screen@Widgetโ overrides the default widget type
๐จ Fluent Builder API
Need more control? Use StarConfigBuilder for a fully programmatic approach:
StarConfigBuilder.create("mymod")
.parent(parentScreen)
.tab("general", tab -> tab
.icon(Items.CRAFTING_TABLE)
.section("scanning", section -> section
.intSlider("scanRange", b -> b
.range(1, 64).defaultValue(16)
.binding(() -> config.scanRange,
v -> config.scanRange = v))
)
)
.onSave(() -> serializer.save())
.build();
๐พ JSON Persistence
GsonConfigSerializer handles loading and saving config files as readable JSON. Files are stored in config/<mod-id>.json following Fabric conventions.
๐๏ธ Rich Widget Types
- Toggles for booleans
- Sliders for numbers with ranges
- Steppers for integer values
- Enum cycles for enum selections
- String fields for text input
- Description entries for informational text
๐ Mod Menu Integration
Register your config screen with a single class:
public class MyModMenuIntegration implements ModMenuApi {
@Override
public ConfigScreenFactory<?> getModConfigScreenFactory() {
return ModMenuConfigFactory.create("mymod", MyConfig.class, MyConfig::get);
}
}
๐งฉ Conditional Fields
Use @EnabledWhen to create dependent settings that gray out when their condition isn't met:
@EnabledWhen(field = "pacingMode", notEquals = "ADAPTIVE")
private int linesPerSecond = 4;
๐ฆ Installation
For Mod Developers
Add to your build.gradle.kts:
dependencies {
modstitchModImplementation("com.starshadow:starshadow-config:${property("starshadow_version")}")
modstitchModImplementation("com.starshadow:starshadow-lib:${property("starshadow_version")}")
include("com.starshadow:starshadow-config:${property("starshadow_version")}")
include("com.starshadow:starshadow-lib:${property("starshadow_version")}")
}
For Players
Starshadow Config is bundled inside mods that use it โ you typically don't need to install it separately. If a mod requires it as an external dependency:
- Install Fabric Loader for your Minecraft version
- Install Fabric API
- Drop the Starshadow Config and Starshadow Lib
.jarfiles into yourmods/folder - Launch Minecraft
Supported: Minecraft 1.20.1 ยท 1.20.4 ยท 1.21.1 โ Fabric only
๐งฉ Compatibility
| Mod | Compatibility |
|---|---|
| Fabric API | โ Required |
| Mod Menu | โ Optional โ config screen registration (not needed if Starshadow Menu is installed) |
| Starshadow Menu | โ Optional โ config screen discovery |
| Cloth Config | โ Can coexist โ different config systems |
๐ Requirements
| Dependency | Required? |
|---|---|
| Fabric Loader | โ Yes |
| Fabric API | โ Yes |
| Starshadow Lib | โ Yes |
| Mod Menu or Starshadow Menu | Optional โ either provides config screen access |
๐ Config Made Simple
Stop writing hundreds of lines of config screen code. Starshadow Config turns your config class into a beautiful, functional settings screen โ automatically.
Made with โค๏ธ by Ghent Starshadow Licensed under MPL-2.0 โ free to use, share, and modify.



