|The contents of this page are not supported by Mojang AB, the Minecraft Wiki, the or the .|
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. You can create mods for Minecraft on all computer operating systems(Windows(MinecraftInstaller.msi + Minecraft.exe), OS X(Minecraft.dmg) and Linux(and any computer you can "linuxify" e.g.: Chromebook)(Minecraft.jar(Windows and OS X can use this one too))) that you can get PC minecraft on and on PE Android. You can play mods on these operating systems and IOS and AmazonFire TV. You can not make mods on consoles or Raspberry Pi.
- 1 Other Tutorials
- 2 Tools
- 3 The Minecraft Forge API
- 4 Learning Java
- 5 Tutorials
- 6 Tips
- 7 Creating mods without MCP
Other Tutorials[edit | edit source]
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.
Tools[edit | edit source]
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(Application Programming Interface) 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. It has been discontinued since the 1.6.2 version and the 1.6.2 bugfix by Acomputerdog. It loads mod class files in each minecraft version .jar file. Prior to 1.6 it and ModLoaderMP loaded mod class files in the old minecraft.jar file in the old "bin" folder. Forge and FML used to load mod class files prior to 1.5, but in 1.5 it started to load .jar and .zip mods in a new folder called "mods". ModLoader and ModloaderMP have to be installed manually by adding the classes to the version .jar files. Forge and FML were installed in the same way until 1.5 where they had installers which installed them in the libraries folder. Modloader has been around since one of the first alpha testing versions of minecraft. The creator of this modloader is called Risugami. ModLoader only works on clientside worlds.
- ModLoaderMP has been around since the early versions of beta testing, but development was discontinued in 1.3.2.
- 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 server plugin API. Bukkit is supported by Dinnerbone, a member of Mojang.
- Decompiling tools help you work with Minecraft's source code, which is not published by Mojang. These tools turn compiled, executable, java code into source code.
- FMC(Fyddle for MineCraft) is a alternative to MCP.
- 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 CFR 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. Also fernflower is no longer being updated, but lives on in the AndroChef java decompiler which based most of it's code off fernflower. Also I think that the second best decompiler is Procyon which is open source and also supports JDK 8. The main developer for Procyon and the main developer for CFR challenged each other to develop the best java decompiler.
- 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.
- JBoss Developer is a large and very good addon for Eclipse.
- Compiling tools turn source code into a high-level, 3rd-5th generation, 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.
- ECJ is part of the Eclipse IDE and Power J is part of another IDE.
- Debugging tools search for issues in the mod's code and help fix them. There is a default java debugger called jdb(Java DeBugger) which comes with JDK.
- OpenMods has made some debug tools designed for minecraft.
- Deobfuscation tools help deobfuscate complex obfuscated code and make it easier to understand. They can help you understand more about how minecraft works and how other mods work. They can be useful when you want to continue a abandoned mod. They also let you make the code of your mod easier for other developers to understand so that the development of the mod is finished more quickly. Don't confuse these with decompiling tools.
- MCP deals with deobfuscation as well as compiling.
- Enigma is a deobfuscation tool made using Procycon.
- Immibis's BON(Bearded Octo Nemesis) is a tool that also can be used for deobfuscating Minecraft-related code. It is recommended that if you want to deobfuscate using BON and also decompile the code it is recommended that you use the JDGui decompiler if you want to and also it is recommended that you use MCP if you want to.
- Java deobfuscators for general java coding like JMD(Java Multipurpose Deobfuscator) and JBO(Java DeObfuscator) are useful too. The best java deobfuscator is probably JBO because it has got into stable release, as JMD was in development, only available as open source and development on it has stopped long ago. You can still get it and use it if you turn the source code into programming code by compiling. JBO is written in the C# programming language and is used to decompile the java programming language. You can get JBO on SourceForge(I recommend you to download non-development versions from here(in the binary folder)) and on GitHub. You can get JMD on GitHub and JavaSED.
- Obfuscation tools help make you code harder for other programmers to read so it makes it harder for programmers to copy your code and use it to make a mod that replaces your mod. It help stops people from making unofficial copies of your mod without your permission.
- The class file assembler called Jasmin is used to create java class files to put in a .jar folder. This tool creates class files inside you mod's .jar file to put your mod's code in. It generates these class files from assembly code and changes them into java code class files.
- Class file disassemblers, such as the default JDK java class file disassembler, javap, or the opposite of Jasmin, Jaspar, are used to take apart java class files.
- Compiler-compilers(also known as compiler generators, parser generators or lexer generators) are compiler, parser and lexer generators(parsers and lexers are parts of a compiler, parsers do parsing and lexers do lexical analysis). If you want to create your own custom compiler because none of of the compilers that exist for java suit you or maybe you want to create a compiler designed for minecraft modding and modding tools. Compiler-compilers compile a compiler from low-level programming language, 2nd generation programming language, assembly code into high-level programming language, 3rd generation programming language, java. A list of lexer generators is available here, and a list of parser generators is available here. Lexers organise assembly code and source code into high-level 3rd generation java programming language "words" and parsers organise these words into "sentences" so that the "words" can be understood as java. Currently you can't get any lexers that are separate from a compiler for java, but you can generate java lexers using java lexer generators.
- The JavaParser(JP) is a program or parser that gets a certain instruction or command or bit of code then it breaks up that item into bits that can be processed by other programming tools or other bits of a compiler. It also makes sure that all the code put in is necessary, and it excludes the code that is not needed. JavaParser is the only java parser that is not part of a compiler. JDK has it's own parser. JavaParser was first available on GoogleCode, but since GoogleCode has become less popular and you can no longer create new projects, it has now moved to GitHub.
- Java code generators these tools help you generate java code and java source code. Codemodel, JAXB, DMSToolkit and JavaFrontEnd are examples of these.
- Checkmarx is a website that offers various tools from analysing source code to protecting your code by blocking risks to learning how to make your software more secure.
- Text editors can be used to create mods, but coding using a text editor is super hard. The code they show is normally very hard for someone to understand. You might be able to understand a few bits of the code, but most of it is illegible to people who are not skilled in reading the code shown. Notepad is the default text editor for windows, but Notepad++ is probably the best, especially for coding. A list of text editors is available here and a comparison here.
- File archivers, such as WinRAR, 7-Zip and WinZip, are useful for compressing, extracting, copying, deleting, editing, renaming and viewing class files within .jar files, .zip files, .rar files and .litemod files. They give you access to the class files within mods. A list of file acrhivers is available here.
- Revision control software help you create many separate coding projects, some being open-source, undo and redo various edits, assign issues to yourself and others, share your code with other mod developers and code with mod developers all over the world to help create your mod. This kind of software helps you develop code more quickly, share code easily and fix problems. One of the most well known out of revision control software is probably Git which was created by Linus Torvalds(the creator of the operating system Linux). Also the company called Atlassian(the creators of BitBucket) has created tons of revision control software, the main one being JIRA. A list of revision control software is here and a comparison of revision control software is here. A list of text editors is here and a comparison here.
- Continuous integration(CI) software help mod developers share code easily and integrate code into repositories and when you change code on a computer they can sync it with the repository on the internet. They also help test your mod and let other mod developers help you. CIs let you easily update your software several times a day. CIs also help you combine code together from other repositories. A well known CI is Jenkins which is a online software extension to JIRA and is based off of the Hudson CI tool. Bamboo by Atlassian is also another well known CI. A list of CIs is available here.
- File synchronization software help sync files between two different locations on a computer or between two computers. When you edit one file the file on the other computer get automatically edited so the files are identical. A list of file synchronization software can be found here. You can sync mods using this.
- Disk cloning software help cone files from one hard drive to another hard drive. A list of disk cloning software is available here and a comparison here.
- File sharing applications help share files with other people. You can share your mod with other people using these. A list is here.
- File hosting services are an easy way to make your mod publicly available for download or editing on the internet. They can let you upload and edit files on the internet, share links with other people and sync files between the internet and other computers. Some of the most well known file hosting services are Google Drive, Dropbox, Mediafire and MEGA. A list of file hosting services is here. Zoolz, Uploaded and File-Upload.net are not included in this list. There are two main file hosting websites for minecraft mods called CurseForge(made by Curse the company that made this wiki, also you can download(but not create) CurseForge projects from the Curse website) and Planet Minecraft.
- Backup software help backup, save and rescue files. They help make sure you don't lose or corrupt any important files. A list is here and a comparison here.
- Online backup services help backup files online. A list is available here.
- Source code hosting facilities, such as GitHub, BitBucket, Google Code and SourceForge, help create open source software and mods online and edit files and share files with programmers around the world. The can let you undo and redo edits, make downloadable source code and have compiled software downloads. A list is available here.
- Free software project directories give you a place to develop software in repositories. A list is available here.
- Wikia is a website which lets you create wikis about your mod and what it adds into the game and how to use your mod and there are also forums that let people suggest their own ideas to make the mod better.
- 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.
- ID fixers are normally forge mods that help make sure mod biome, dimension, item and block IDs don't conflict. ID fixers help make your mod's IDs compatible with the IDs of other mods. Idfix and Idfix Minus are some of the most well known ID fixers and are available for 1.6.4. Another ID fixer is ID Resolver for 1.5.1-1.6.2. ID Resolver is also open-source on GitHub and is available as a compiled version on GitHub for 1.6.2. ID Resolver needs the mod GuiAPI in order to work. ID Status Helper helps by telling you how many id slots have been used and how many there are left. ID Status Helper also needs GuiAPI in order to work. IDFixer is a ID fixer for 1.7.10. ExtendedMetadata for 1.8 adds more ID slots for you to use. Minecraft ID-Helper is a program which shows all the ids and id conflicts. IDScanner is a program that searches for conflicts, lets you see the empty ID slots and lets you solve the conflict. Item ID Searcher is a program that helps you search through all the item IDs. The Block ID tool also searches through IDs. Minecraft ID Finder lets you select a block or item and get the ID of that block or item. Python Minecraft ID Resolver is a program project on GitHub. The ID disabler mod called Disallowed is open source on GitHub and can be downloaded here. Minecraft ID Search Tool is a program that searches for block and item IDs. Block ID Conflict Resolver is a program that resolves block ID conflicts. Minecraft Searchable ID List is a program lists all the IDs and is open source. MineConf is a program that lets you easily change IDs. Minecraft ID List Application lists all the IDs. ID Checker is a non-forge and forge mod for 1.0.0 which lets you check for conflicting IDs. Minecraft Texture ID Viewer lets you view all the texture ids. Minecraft Block To ID Finder can be used to find block IDs. Minecraft Item ID Database is a program which shows all the item IDs. Minecraft Item-ID Caller helps find the ID of items.
- Crash report analysers are forge mods that help analyse crash reports and try to find solutions to the problems. These can help mod developers find out what problems their mod has and fix those problems. The most well known is OpenEye, a 1.7.10 mod, which gathers more information on crashes. OpenEye needs OpenModsLib in order to work. OpenEye was made by OpenMods. Minecraft Crash Report Analyser, a mod for 1.7.10, helps find the solution to crashes by checking if it knows the solution to that crash, and if it does know the solution it will tell you what the solution is. Jenkins builds made by OpenMods.
- World editing and world generation tools can help you generate or create large and complex structures and copy structures from world to world. You could input these structures into MCreator or use the structures to test how you want structures in your mod to be in your mod. If you want to create a dimension that is created in a certain way like The Lord of the Rings Mod these tools probably will help. The three world editing and world generation tools are: MCEdit, WorldPainter and WorldEdit.
- MCEdit lets you copy, create, select, manipulate and delete structures in your world. It can also create and export MCEdit schematic files for each structure you create and you can import these to different worlds. It is also possible to create "schematic mods" by adding extra code to the schematic files, and combining the code of various items in minecraft to create new ones. A lot of "schematic mods" use armor stands and item frames for their code. These "schematic mods" are added to world saves. You just need to copy the "schematic mod" world save into your .minecraft saves folder or import the schematic file into one of your worlds using MCEdit, and the "schematic mod" is installed. These "schematic mods" can be used serverside and clientside and are technically vanilla since anyone with vanilla minecraft can use them. A few of the best schematic mods are this Remote Control Helicopter and this Camp Fire Command and Redstone "Schematic Mod". You can also use texture packs for you world saves to go with these "schematic mods".
- WorldPainter lets you paint part of a world and a part of a world is generated it that particular way. This can be useful for making biomes and dimensions
- WorldEdit is like MCEdit, but in-game. It also lets you create WorldEdit schematic files. WorldEdit is a Forge mod. There is a LiteLoader version called the WorldEdit Wrappper of this mod is being updated by the creator of LiteLoader, Mumfrey. WorldEdit is also available as a Bukkit plugin. WorldEditCUI is a clientside LiteLoader mod made by Mumfrey lets you adjust the selection of shapes and lets you create cubes, rectangles, triangles, spheres, pentagons and other shapes. WorldEdit, WorldEdit Wrapper and WorldEditCUI are open-source on GitHub. A older version of WorldEdit is available with MinecraftEdu. There is also a CanaryMod plugin. You can also get a hMod plugin.
- Height mods are useful when you want your mod to generate massive structures above the build limit. Add in a line of code that tests to see if a height mod is installed and your mod generates larger structures. There are many height mods, but the best ones are cubic chunks mods. Normal height mods generate massive vertical chunks the vanilla way which creates tons of lag, but cubic chunks mods split the vertical chunks with horizontal lines and load 16x16 cubic chunks. These cubic chunks reduce lag because they are smaller and the game needs to to load less. So far three cubic chunks mods have been made: Robinton's Cubic Chunks Mod for 1.0.1, Barteks2x's Cubic Chunks Mod for 1.6.2(but it still works on 1.6.4), and Cuchaz's Tall Worlds Cubic Chunks Mod for 1.8.3. Robinton's Cubic Chunks Mod is a Forge mod, Barteks2x's Cubic Chunks Mod is a vanilla class file installation mod and Cuchaz's Tall Worlds Mod is a M3L mod(only M3L mod at the moment)(made using the Procyon decompiler, Cuchaz's Minecraft Mappings and Cuchaz's Enigma(and a bit of MCP), and based off the previous height mods). A list of height mods(except Barteks2x's Cubic Chunks Mod and Cuchaz's Tall Worlds Cubic Chunks Mod) is available here(Dynamic Height is downloadable from here).
- MCPatcher is a tool that helps "patch" and fix texture errors and issues.
- 3D modeling and texture tools, such as MCAnimator or Techne, help you create or modify a TileEntity or Entity. List of Modeling Tools. List of Texture Tools. GIMP is a example of a texture tool. There are also also wikipedia lists here and here.
- Raster graphics editors and vector graphics editors help let you edit the image files in your mod. Raster graphics editors simply edit the textures, but vector graphics editors allow you to create textures that always remain as high definition as possible. Some of the most well known raster graphics editors are Paint and Paint.NET. A list of raster graphics editors is here and a list of vector graphics editors is here.
- Protocol analysis tools, many of which are documented on the List #mcdevs wiki, can be useful for debugging multiplayer mods.
- Other APIs can be useful as well. Examples: GuiAPI(GUI stands for Graphical User Interface), LibShapeDraw, Player API, more... Most of 1.7.10 the mods with: Core, Lib, Util or API can be found in this modlist. However, some APIs such as IC2 API, Waila API, MattparksCore, Baubles API API and Galacticraft API are not listed.
The Minecraft Forge API[edit | edit source]
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 | edit source]
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.
Tutorials[edit | edit source]
Warning: These are outdated Risugami's modloader tutorials. This page needs more tutorials for the modloaders specified in the talk page.
Setting up the MCP workspace[edit | edit source]
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 | edit source]
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 | edit source]
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 | edit source]
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 | edit source]
This tutorial shows you how to create a mob with Techne.
Adding recipes[edit | edit source]
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 | edit source]
Recompiling and reobfuscating[edit | edit source]
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.
Tips[edit | edit source]
- 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 | edit source]
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.