### ModResolutionException Example Source: https://github.com/fuzss/forge-config-api-port/wiki/Troubleshooting-Guide This error message indicates an incompatibility with the Night Config library. It suggests installing specific versions of the core and toml modules. ```text net.fabricmc.loader.impl.FormattedException: net.fabricmc.loader.impl.discovery.ModResolutionException: Mod resolution encountered an incompatible mod set! A potential solution has been determined: - Install com_electronwill_night-config_core, any version. - Install com_electronwill_night-config_toml, any version. ``` -------------------------------- ### Configure Dependencies for VanillaGradle Source: https://github.com/fuzss/forge-config-api-port/wiki/Getting-Started-(for-Minecraft-1.20.2-and-up) Add Forge Config API Port as a dependency for your project when using VanillaGradle. Choose the NeoForge or Minecraft Forge API distribution as needed. ```kotlin dependencies { // NeoForge's config system api("fuzs.forgeconfigapiport:forgeconfigapiport-common-neoforgeapi:") // Minecraft Forge's config system api("fuzs.forgeconfigapiport:forgeconfigapiport-common-forgeapi:") } ``` -------------------------------- ### Listen to NeoForge API Events on NeoForge Source: https://github.com/fuzss/forge-config-api-port/wiki/Config-Loading-Events-(for-Minecraft-1.21.5-and-up) Register a listener for the loading event of NeoForge API configs directly on NeoForge. This uses the FML event bus. ```java net.neoforged.fml.javafmlmod.FMLJavaModLoadingContext.get().getModEventBus().addListener((final net.neoforged.fml.event.config.ModConfigEvent.Loading evt) -> { <...> }); ``` -------------------------------- ### Configure Gradle Repositories Source: https://github.com/fuzss/forge-config-api-port/wiki/Getting-Started-(for-Minecraft-1.20.2-and-up) Add the Fuzs Mod Resources Maven repository to your Gradle build script to access the library. ```groovy repositories { maven { name = "Fuzs Mod Resources" url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven/" } } ``` -------------------------------- ### Register Config with Mod ID and File Name Source: https://github.com/fuzss/forge-config-api-port/wiki/Registering-Configs-(for-Minecraft-1.21.5-and-up) Use this method to register a configuration specification with a specific mod ID, type, and a custom file name. Ensure the file name includes the correct extension, typically '.toml'. ```java void register(String modId, ModConfig.Type type, IConfigSpec spec, String fileName) ``` -------------------------------- ### Configure Dependencies for NeoGradle Source: https://github.com/fuzss/forge-config-api-port/wiki/Getting-Started-(for-Minecraft-1.20.2-and-up) Add the NeoForge distribution of Forge Config API Port as a dependency when using NeoGradle. ```kotlin dependencies { api("fuzs.forgeconfigapiport:forgeconfigapiport-neoforge:") } ``` -------------------------------- ### Listen to NeoForge API Events on Fabric Source: https://github.com/fuzss/forge-config-api-port/wiki/Config-Loading-Events-(for-Minecraft-1.21.5-and-up) Register a listener for the loading event of NeoForge API configs on Fabric. Replace `` with your mod's ID. ```java fuzs.forgeconfigapiport.fabric.api.v5.ModConfigEvents.loading().register((net.neoforged.fml.config.ModConfig config) -> { <...> }); ``` -------------------------------- ### Add Forge Config Screens to Gradle Build Source: https://github.com/fuzss/forge-config-api-port/wiki/Home Include these repositories and dependencies in your Gradle build script to integrate Forge Config Screens into your development environment. Replace `` with the appropriate version. ```groovy repositories { maven { name = "Fuzs Mod Resources" url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven/" } } dependencies { // Fabric modLocalRuntime "fuzs.forgeconfigscreens:forgeconfigscreens-fabric:" // NeoForge runtimeOnly "fuzs.forgeconfigscreens:forgeconfigscreens-neoforge:" // Forge runtimeOnly(fg.deobf("fuzs.forgeconfigscreens:forgeconfigscreens-forge:")) } ``` -------------------------------- ### Listen to Minecraft Forge API Events on NeoForge Source: https://github.com/fuzss/forge-config-api-port/wiki/Config-Loading-Events-(for-Minecraft-1.21.5-and-up) Register a listener for the loading event of Minecraft Forge API configs directly on NeoForge. This uses the FML event bus. ```java net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext.get().getModEventBus().addListener((final net.minecraftforge.fml.event.config.ModConfigEvent.Loading evt) -> { <...> }); ``` -------------------------------- ### Configure Dependencies for ForgeGradle Source: https://github.com/fuzss/forge-config-api-port/wiki/Getting-Started-(for-Minecraft-1.20.2-and-up) Add the Forge distribution of Forge Config API Port as a dependency when using ForgeGradle. ```kotlin dependencies { api("fuzs.forgeconfigapiport:forgeconfigapiport-forge:") } ``` -------------------------------- ### Register Config with Mod ID Source: https://github.com/fuzss/forge-config-api-port/wiki/Registering-Configs-(for-Minecraft-1.21.5-and-up) This method is used to register a configuration specification with a specified mod ID and type. The configuration will be saved to a default file name based on the mod ID and type. ```java void register(String modId, ModConfig.Type type, IConfigSpec spec) ``` -------------------------------- ### Configure Dependencies for Fabric Loom / Architectury Loom Source: https://github.com/fuzss/forge-config-api-port/wiki/Getting-Started-(for-Minecraft-1.20.2-and-up) Add the Fabric distribution of Forge Config API Port as a dependency when using Fabric Loom or Architectury Loom. ```kotlin dependencies { modApi("fuzs.forgeconfigapiport:forgeconfigapiport-fabric:") } ``` -------------------------------- ### Forge/NeoForge Copyright and License Header Source: https://github.com/fuzss/forge-config-api-port/blob/main/LICENSING.md This is the standard copyright and license header for classes copied from Minecraft Forge or NeoForge. It indicates the code is licensed under LGPL-2.1-only. ```java /* * Copyright (c) Forge Development LLC and contributors * SPDX-License-Identifier: LGPL-2.1-only */ ``` -------------------------------- ### Dependency Overrides Configuration Source: https://github.com/fuzss/forge-config-api-port/wiki/Troubleshooting-Guide Manually configure dependency overrides to resolve Night Config compatibility issues. Create a `fabric_loader_dependencies.json` file in the `run/config` directory with these contents. ```json { "version": 1, "overrides": { "forgeconfigapiport": { "-depends": { "com_electronwill_night-config_core": "", "com_electronwill_night-config_toml": "" } } } } ``` -------------------------------- ### Listen to Minecraft Forge API Events on Fabric Source: https://github.com/fuzss/forge-config-api-port/wiki/Config-Loading-Events-(for-Minecraft-1.21.5-and-up) Register a listener for the loading event of Minecraft Forge API configs on Fabric. Replace `` with your mod's ID. ```java fuzs.forgeconfigapiport.fabric.api.v5.ModConfigEvents.loading().register((net.minecraftforge.fml.config.ModConfig config) -> { <...> }); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.