Mods/Creating mods

From Minecraft Wiki
Jump to: navigation, search
The contents of this page are not supported by Mojang AB, the Minecraft Wiki, the Minecraft IRC channel or the Minecraft Forums.

Minecraft modding is one of the most popular features introduced into the community. There are many different kinds of mods. This tutorial will present you information on how to make your very own Minecraft mod, whether it be with Modloader, Minecraft Forge or hard coded in to the core source. Some knowledge of Java is necessary; it is assumed the reader is familiar with common programming terminology.

Other Tutorials[edit]

For other tutorials not listed on this page (including some that are), the Minecraft Forums Modding Tutorials page will help to create your first mod. There are various tutorials for both ModLoader and Minecraft Forge.


There are many tools that can be used to mod Minecraft. The following is a list of any that people put on here or suggest in the discussion page.

  • Mod loading APIs standardize things, allowing for compatibility between mods. The official Minecraft API is not published yet. In the meantime, the Minecraft modding community has filled that void:
  • ModLoader is among the oldest and was previously one of the most popular mod APIs, although since it has lost most of its popularity to Minecraft Forge.
  • Minecraft Forge is backwards-compatible with ModLoader and also adds hundreds of additional methods, classes, and utilities to assist mod authors.
  • Bukkit is a popular server-side-only API.
  • Decompiling tools help you work with Minecraft's source code, which is not published by Mojang.
  • The Minecraft Coder Pack utility (MCP) is the community-standard tool to both decompile and deobfuscate the Minecraft code, making it much easier to read and modify.
  • General-purpose Java decompilers, such as JD, JAD and fernflower, will help you when MCP is not released or unavailable (for example, when modding snapshots). The best one probably is CRF because it is probably the only Java Decomiler that supports the latest Java version and JavaDevelopmentKit(JDK), Java 8. A list of Java Decompilers is here.
  • An IDE (Integrated Development Environment) is useful for any nontrivial programming. MCP automatically generates project files for use in Eclipse, a popular Java IDE. The most popular IDE at the moment is Eclipse, but the other two competitors are NetBeans(2nd) and IntelliJ(3rd). A list of Java IDEs is here. Overall Xcode is more popular than IntelliJ, but Xcode is only available on Apple Computers.
  • Compiling tools turn source code into a programming language. You can use these for your own mod's source code and/or the source code of other mods on GitHub and BitBucket.
  • Javac is the most popular compiler at the moment. But the Power J compiler(2nd) is very close and used to be more popular. These are followed by: Jikes(3rd), ECJ(Eclipse Compiler for Java)(4th) and GCJ(GNU Compiler for Java)(5th). A list of Java compilers can be found here and here.
  • ECJ is part of the Eclipse IDE and Power J is part of another IDE.
  • Debuggers search for issues in the mod's code and help fix them.
  • A list of Debuggers can be found here.
  • Simplified mod generators, such as Mod Maker and MCreator, exist for mod authors who don't want to have to write and compile Java code. These are not recommended as they generally create poor quality code, and are very limited.
  • Protocol analysis tools, many of which are documented on the List #mcdevs wiki, can be useful for debugging multiplayer mods.

The Minecraft Forge API[edit]

The Minecraft Forge API is a very useful tool in creating new mods. Its most important use is preventing conflicts between mods. It also contains convenience methods for creating mods more easily than without it; for example, the addSmelting method adds smelting recipes in one line of code. Many other methods exist. Tutorials on using the Forge API can be found many places, including many YouTube videos. It can be downloaded at official forge downloads.

Learning Java[edit]

These tutorials use Java terms that may confuse new users. Below are some links about the structure of Java and what certain terms mean. It is recommended that those who are not knowledgeable in the Java programming language read the links.

For more links, see Helpful Links.


Warning: These are outdated Risugami's modloader tutorials.

Setting up the MCP workspace[edit]

Setting up the MCP workspace allows you to access Minecraft and ModLoader's source code and begin modding. The tutorial provides step-by-step instructions for installing Java SE Developer's Kit, the Minecraft Coder Pack, Eclipse IDE for Java Developers, and other programs/mods required to begin modding. The tutorial is written for Windows, Mac, and Linux operating systems.

Starting your first mod[edit]

This tutorial helps you set up and program the primary file for your mod. This file serves a very important purpose. In future tutorials, they will require that you have entered the code explained in this tutorial. This tutorial requires that you have completed the Setting up the MCP Workspace tutorial first.

Methods in Minecraft[edit]

This guide contains a table that lists how blocks, items, and entities are referenced in the code. These references are listed as methods. This is useful in many tutorials below.

Adding a block/item[edit]

This guide will teach you how to create your very own block.

This guide will teach you how to create your very own item.

Mob Creation[edit]

This tutorial shows you how to create a mob with Techne.

Adding recipes[edit]

This tutorial teaches you how to create unique and simple crafting recipes for items and/or blocks already in the game. It also guides you in creating shapeless recipes and smelting recipes in the Furnace. This tutorial requires that you have completed the Starting your First Mod tutorial.

Making a recipe is not as hard as it looks. All you have to do is figure out what blocks/items you want to be used in you item. Then you insert the items used and you're done!

Creating an armor set[edit]

Recompiling and reobfuscating[edit]

This tutorial is quite small, and allows you to finalize your mod by retrieving the .class files you have created and/or edited to be copied into the minecraft.jar. By sending these .class files to other players, they can play your mod as long as they have ModLoader installed.


  • One of the simplest types of mod is adding new blocks or items. Copy a similar class, and rewrite it as necessary. If the new block or item will share most of its behavior with an existing one, it may be easier to subclass that one and override only the parts that will be different. Depending on the desired behavior and how it will interact with other objects, it may be necessary to modify other classes, which makes it more likely to conflict with other mods.

Creating mods without MCP[edit]

Sometimes it is useful to create mods without MCP. For example, MCP is usually not released for snapshots.

To create mods without MCP you must either decompile obfuscated code or modify java bytecode. Decompiling is easy, but you can decompile only simple classes.