Skip to content

Latest commit

 

History

History
84 lines (67 loc) · 4.37 KB

File metadata and controls

84 lines (67 loc) · 4.37 KB
title ModDeck API Documentation
summary Entry point for developers and AI agents using the ModDeck declarative config-screen library.
audience
mod-developer
coding-agent
environment
common
client
last_verified_commit 4790b77de8b5c728d89099e1ac7637c4b99f1b29

ModDeck API Documentation

ModDeck is a declarative configuration-screen library for Minecraft Java Edition 26.2 and Fabric. Mods register typed options through the public API; ModDeck generates a consistent screen and persists values without requiring each mod to implement Minecraft widgets or file I/O.

The public API lives under com.yoima.moddeck.api. Minecraft client classes are isolated in the src/client source set so the common entrypoint remains dedicated-server safe.

What do you want to do?

What you want to do Start reading Main APIs
Set up ModDeck for the first time in my mod Getting Started ConfigScreenApi, ConfigDefinition.Builder
Register a config screen with typed options Registering Options ConfigDefinition.Builder, all *Option types
Use annotation-driven registration instead of a builder AutoConfig Guide @ModDeckAutoConfig, @AutoEntry, AutoConfig
Make some entries appear or become enabled based on other values Conditional Entries ConfigRequirement, enabledWhen, displayedWhen
Define named presets that users can apply Presets Guide ConfigPreset.Builder, ConfigDefinition.applyPreset
Persist, load, or replace the storage backend Saving and Loading ConfigStorage, JsonConfigStorage, ConfigScreenApi.useStorage
Open a config screen from client code or Mod Menu Client Screens ModDeckApi, ConfigRoute
Create a custom option type with its own widget Custom Options ConfigOption<T>, OptionWidgetRegistry, ValueCodec
Understand when draft values change, when saves happen, and what callbacks fire Lifecycle ConfigOption, ConfigDefinition
Understand the boundary between Common code and Client-only code Client/Common Boundary Source sets, ModDeckApi, OptionWidgetRegistry
Look up exact signatures and behavior of a specific type Reference All types under com.yoima.moddeck.api

Directory layout

  • guides/ — Task-oriented walkthroughs with complete examples.
  • concepts/ — Explanations of ideas that span multiple APIs.
  • reference/ — Exact signatures, behavior, failure modes, and constraints for every public type.
  • examples/ — Self-contained, compilable code samples.
  • AGENTS.md — Rules for AI agents that read or update this documentation.

Quick example

import com.yoima.moddeck.api.ConfigDefinition;
import com.yoima.moddeck.api.ConfigScreenApi;
import com.yoima.moddeck.api.ConfigText;

ConfigScreenApi.register(
    ConfigDefinition.builder("example_mod")
        .titleKey("example_mod.config.title")
        .categoryKey("general", "example_mod.category.general")
        .booleanOptionKey("enabled", "example_mod.option.enabled",
            "example_mod.option.enabled.description", true)
        .integerOption("volume",
            ConfigText.translatable("example_mod.option.volume"),
            ConfigText.translatable("example_mod.option.volume.description"),
            50, 0, 100, 1)
        .build()
);

Requirements

  • Minecraft Java Edition 26.2
  • Fabric Loader 0.19.3 or newer
  • Fabric API 0.155.2+26.2 or newer
  • Java 25

ModDeck is published on the Modrinth Maven repository (https://api.modrinth.com/maven). Add it to your build.gradle as implementation 'maven.modrinth:mod-deck:0.1.0' (standard implementation, never modImplementation, because this is a non-obfuscated Fabric 26.2 project) and declare moddeck as a dependency in your fabric.mod.json. See Getting Started for the full setup.

For AI agents

If you are an AI coding agent working with ModDeck, read AGENTS.md first.

Links