Skip to main content
← All Guides
Modding · 6 min read

How to Edit Existing Mods, Forge Modding Basics

Learn the fundamentals of decompiling, editing and recompiling Minecraft Forge mods, from setting up an MCP workspace to making safe, simple changes.

Sometimes a mod does almost everything you need but one config value is hard-coded, a recipe feels wrong, or a feature has a small bug the author has not fixed yet. Rather than waiting for an update, you can edit mods forge basics style, decompile the jar, make targeted changes, and recompile. This guide walks through the process safely and legally.

Before you start: legal and ethical notes

Most Minecraft mods are released under open-source licenses (MIT, LGPL, Apache 2.0) or "All Rights Reserved" with an implicit permission to modify for personal use. Never redistribute a modified mod publicly without the author's explicit permission. If you fix a bug, submit a pull request on GitHub instead. Editing for private server use is generally fine.

Setting up a Forge MDK workspace

The Forge Mod Development Kit (MDK) gives you a decompiled Minecraft source tree and Gradle tasks for building mods. Download the MDK for your target Minecraft version from files.minecraftforge.net (or the NeoForge equivalent from neoforged.net for 1.21+). Unzip it and run:

./gradlew genEclipseRuns   # for Eclipse
./gradlew genIntellijRuns  # for IntelliJ IDEA

This downloads the decompiled Minecraft source, mappings, and all dependencies. The process takes a few minutes on the first run.

IDE recommendations

IntelliJ IDEA Community Edition is the most popular choice. Install the Minecraft Development plugin for syntax highlighting of registry names, mixin annotations, and @Mod metadata. Eclipse and VS Code work too, but IntelliJ has the best Gradle integration.

Decompiling the target mod

Mod jars are standard Java archives. To read the source:

  1. Rename the .jar to .zip and extract it, or use a tool like JD-GUI, Vineflower (formerly Quiltflower), or CFR to decompile the class files.
  2. Vineflower produces the cleanest output for modern Minecraft mods: java -jar vineflower.jar mod.jar output/
  3. Open the decompiled source alongside the MDK project so you can cross-reference Minecraft's own classes.

You now have readable Java source for every class in the mod. Locate the file you need to change, search for config keys, item names, or log messages to find the right class quickly.

Making changes

When you edit mods forge basics, keep changes minimal and surgical. Common edits include:

  • Changing a hard-coded value, swap a constant for a config-driven field.
  • Fixing a null-pointer crash, add a null check before the offending line.
  • Adjusting a recipe, modify the JSON files in data/modid/recipes/ inside the jar (no Java changes needed).
  • Removing a feature, comment out the registration call in the mod's initializer.

For recipe and loot-table changes you do not need to recompile at all, just edit the JSON files and repackage the jar. For Java changes, you need to recompile.

Recompiling and repackaging

If you only changed JSON or asset files, repackage with: jar cf modname-modified.jar -C extracted/ .

If you changed Java source, place the modified classes in an MDK-structured project, update build.gradle with the mod's dependencies, and run ./gradlew build. The output jar lands in build/libs/.

Testing your changes

Drop the modified jar into your mods/ folder (remove the original first) and launch the game. Check the log for errors. If the mod uses mixins or access transformers, those must stay intact or the game will crash on load. Our fix server not starting guide covers common crash patterns.

The mixin alternative

If you want to change a mod's behavior without touching its jar at all, you can write a small companion mod that uses Mixin to inject, redirect, or overwrite methods at runtime. This is cleaner for server environments because you keep the original mod untouched and your patch is a separate, version-independent jar. Mixin is well-documented on the SpongePowered wiki.

When editing mods is not the answer

For large-scale changes, forking the mod on GitHub and maintaining your own branch is more sustainable. For simple tweaks like recipes, crafting overhauls, or loot tables, use KubeJS or CraftTweaker instead, they let you override any mod's recipes with script files and zero Java. If your goal is adding entirely new items and blocks, see our guide on how to add custom items.

Understanding how to edit mods forge basics gives you the confidence to fix problems yourself instead of waiting for upstream patches. Start small, keep backups, and always respect mod authors' licenses.

Want to experience custom content done right? Join Astroworld MC, IP play.astroworldmc.com, Java + Bedrock.

Related Tools & Resources

🔧

Minecraft Tools

Calculators, generators & server tools

🧱

Item Database

Browse all Minecraft items, stats & recipes

⚒️

Crafting Recipes

Visual crafting guides for every recipe