LogoLogo
  • Introduction
  • Documentation License
  • Modding Basics
  • Getting Started
  • Configuration
    • Creating a Config
    • Config Options
      • Boolean Configs
      • Number Configs
      • Selector Configs
      • Text Configs
      • Buttons, Colors and Keybinds
      • Decorative Components
      • Custom options
    • Migration
  • Events
    • Event Basics
    • Available Events
      • ChatReceiveEvent
      • TickEvent
      • InitializationEvent
      • HudRenderEvent
      • Packet Events
      • LocrawEvent
  • Graphics & UI
    • Render Manager
      • Font Rendering
    • Elements
    • Pages
  • Commands
    • Commands
    • An Example Command
  • HUDs
    • HUD Basics
  • Utilities
    • OneConfig's Utilities
      • Notifications
      • HypixelUtils
    • OneColor
    • OneUIScreen
Powered by GitBook
On this page
  • OneConfig's Example Mod
  • Including OneConfig Yourself

Was this helpful?

Getting Started

(aka "How the hell do I add OneConfig to my mod?")

PreviousModding BasicsNextCreating a Config

Last updated 1 year ago

Was this helpful?

If you're unfamiliar with Java, or Minecraft Modding, please read first. It's a fantastic beginner's guide.

OneConfig's Example Mod

If you're just starting out or need more advanced features like multiple versions, we highly recommend looking at our updated .

Including OneConfig Yourself

If you want to avoid using our own , or wish to include OneConfig in one of your new or existing mods, add this to your build.gradle(.kts)

loom {
    launchConfigs {
        client {
            // Loads OneConfig in dev env. Replace other tweak classes with this, but keep any other attributes!
            arg("--tweakClass", "cc.polyfrost.oneconfig.loader.stage0.LaunchWrapperTweaker")
        }
    }
}

repositories {
    maven { url 'https://repo.polyfrost.cc/releases' }
}

dependencies {
    // Basic OneConfig dependencies for legacy versions. See OneConfig example mod for more info
    compileOnly('cc.polyfrost:oneconfig-1.8.9-forge:0.2.2-alpha+') // Should not be included in jar
    // include should be replaced with a configuration that includes this in the jar
    include('cc.polyfrost:oneconfig-wrapper-launchwrapper:1.0.0-beta+') // Should be included in jar
}

jar { // loads OneConfig at launch. Add these launch attributes but keep your old attributes!
    manifest.attributes(
            "ModSide": "CLIENT",
            "TweakOrder": "0",
            "ForceLoadAsMod": true,
            "TweakClass": "cc.polyfrost.oneconfig.loader.stage0.LaunchWrapperTweaker",
    )
}
loom {
    launchConfigs.named("client") {
         // Loads OneConfig in dev env. Replace other tweak classes with this, but keep any other attributes!
         arg("--tweakClass", "cc.polyfrost.oneconfig.loader.stage0.LaunchWrapperTweaker")
    }
}

repositories {
    maven("https://repo.polyfrost.cc/releases")
}

dependencies {
    // Basic OneConfig dependencies for legacy versions. See OneConfig example mod for more info
    compileOnly("cc.polyfrost:oneconfig-1.8.9-forge:0.2.2-alpha+") // Should not be included in jar
    // include should be replaced with a configuration that includes this in the jar
    include("cc.polyfrost:oneconfig-wrapper-launchwrapper:1.0.0-beta+") // Should be included in jar
}

tasks {
    jar { // loads OneConfig at launch. Add these launch attributes but keep your old attributes!
        manifest.attributes += mapOf(
            "ModSide" to "CLIENT",
            "TweakOrder" to 0,
            "ForceLoadAsMod" to true,
            "TweakClass" to "cc.polyfrost.oneconfig.loader.stage0.LaunchWrapperTweaker"
        )
    }
}
Modding Basics
example mod
mod template