Minecraft Blogs / Tutorial

Creating a Minecraft Forge 1.7.10 Mod

  • 10,661 views, 3 today
  • 6
  • 4
  • 6
QuickWhitt7's Avatar QuickWhitt7
Level 34 : Artisan Creeper Hugger
13
THIS IS A WORK-IN-PROGRESS TUTORIAL! GIVE IT SOME TIME TO MATURE!

Hair lair there, and welcome to my tutorial on how to create a Minecraft mod for 1.7.10, using Minecraft Forge. Let's get started.

Setting Up Your Workspace


Required Materials


You will need the following programs and materials:
1) Eclipse IDE
2) Minecraft Forge (see below for installation details)
3) JDK 8
4) Some sort of archiving program, like 7-Zip

Installing Forge


Upon clicking the link that should lead to the Minecraft Forge Files site, go to the list item that says "1.7.10-Latest", and download both the Installer (Mac and Linux users should click the link that says "Installer", Windows users should click "Installer-Win") and the SRC (it is labeled as "Src").

Once both the Installer and SRC are installed, you must do the following (this is where the archiving program comes into play): unzip both Eclipse and Forge 1.7.10 to a folder of your naming choice (preferrably to your desktop).

Now, open up your operating system's Command Prompt:
Windows - go to Start Menu --> type in the search bar "cmd" (w/o quotes) --> click the "cmd.exe" application
OS X -  Finder --> Application --> Utilities --> Terminal
Ubuntu - Let me know in the comments.

Type in the command prompt this command:
cd (drag and drop forge folder into terminal window)

Once completed, type in this command:
gradlew setupDecompWorkspace
This will fetch some resources required to create your mod.

Once that process is finished, type in this command:
gradlew eclipse
Once again, this is just fetching some resources required to create the mod (as far as I am able to observe)

Once those processes are finished, close your operating system's command prompt. When it asks for a workspace, choose the folder you created on your desktop. And if you done it correctly, BOOM! You're ready to mod Minecraft 1.7.10.

In case you're wondering whether or not you've done it right, are you able to see a "Minecraft" folder in the "Package Explorer" window of Eclipse? If so, you did it right.

Setting Up Your Main Mod File


1) Create a new Package in the src/main/java folder in Eclipse.
2) Name the Package youremailprovider.youremailaddress.com. This is to prevent confusion with other mod package names.
2A) Replace "youremailprovider" with whatever your email provider is. 
2B) Replace "youremailaddress" with your real email address.
3) Create a new Class, title it "Main" w/o the quotes.
Here's the sample code (courtesy of Minecraft Forums user IanTheSlime):

package youremailprovider.youremailaddress.com;

@Mod(modid="YourModsID", version="YourModsVersion")
public class Main
{
public static String MODID = "modid";
public static String VERSION = "version";

@EventHandler
public void preInit(FMLPreInitializationEvent e)
{
}

@EventHandler
public void init(FMLInitializationEvent e)
{
}

@EventHandler
public void postInit(FMLPostInitializationEvent e)
{
}
}

Setting Up Your Language File


1) Create a new package in src/main/java, title it "assets.YourModsID.lang" w/o quotes
2) Create a new file in the package you just created, title is "en_US.lang" w/o quotes.
For naming blocks, use this syntax:
tile.YourBlock.name=Block

For naming items, use this syntax:
item.yourItem.name=Item

And for item groups (aka the tab in the Creative Inventory), use this syntax:
itemGroup.tabName=Tab

If you have a question or concern, feel free to private message me or comment on the blog post. If you have a problem, leave it as a comment in the blog post, and I will help you as best as I can.

Creating Your "mcmod.info" file

First and foremost, the "mcmod.info" file basically contains metadata for Forge 1.7.10 to read.

With that explained, make sure that everything in "src/main/resources" is deleted (don't delete the directory itself).

Then, create the new mcmod.info file into the src folder. The example syntax is below (the sytnax is for an upcoming mod of mine):

[
{
"modid": "vegas",
"name": "Vegas Mash-Up Pack",
"description": "A random collection of different mods, currently a WiP",
"version": "$version";
"mcversion": "$mcversion";
"url": "",
"updateUrl": "",
"authors": "GunslingerN7"],
"credits": "GunslingerN7",
"logoFile": "",
"screenshots": [],
"dependencies": [mod_MinecraftForge]
}
]

You're ready to mod...


You are now an official modder of Minecraft. Here are some basic tutorials sectioned off.

Creating a Creative Tab


package youremailprovider.youremailaddress.com;

@Mod(modid="YourModID", version="YourModVersion")
public class Main
{
public static String MODID = "YourModID";
public static String VERSION = "YourModVersion";

public static CreativeTabs tabName = new CreativeTabs("tabName")
{
public Item getTabIconItem()
{
return Items.stone;
}
};

@EventHandler
public void preInit(FMLPreInitializationEvent e)
{

}

@EventHandler
public void init(FMLInitializationEvent e)
{

}

@EventHandler
public void postInit(FMLPostInitializationEvent e)
{

}
}

Credits


1) Minecraft Forums user IanTheSlime for basic information
CreditMinecraft Forums User IanTheSlime (for basic information)
Tags

6 Update Logs

Update #6 : by QuickWhitt7 04/01/2015 7:34:30 pmApr 1st, 2015

* Fixed 1 mistake - you need JDK instead of normal Java
LOAD MORE LOGS

Create an account or sign in to comment.

1
03/03/2018 4:34 pm
Level 8 : Apprentice Modder
takochako987
takochako987's Avatar
I know this blog is pretty old, but for everyone still using it: on most Linux distros, "Ctrl + Alt + T" is the shortcut to access the terminal. On Elementary OS the default shortcut is "Super (Windows key) + T."
1
04/01/2016 2:46 pm
Level 1 : New Miner
iComputerfreak
iComputerfreak's Avatar
I have a few additions/corrections found, but since the package names with the points, slashes and everything triggered the spam detection, I pasted it on pastebin. You can read the full comment here: http://pastebin.com/tBVr84EU

If a mod reads this, who can post without triggering the spam detection, it would be nice, if he can copy the comment from the link in here and remove the first line.

I hope this helps other, who have any struggle. If something I said is wrong, don't hesitate to correct me.
Thank you very much thefallen1goth for your tutorial it helped me starting with mod programming again. You did a great job!
1
04/19/2015 8:31 pm
Level 24 : Expert Architect
Planetjoshua
Planetjoshua's Avatar
Good job. But, it can be a boring mod with no items blocks and stuff like it
1
03/30/2015 8:34 pm
Level 23 : Expert Modder
SirBlobman
SirBlobman's Avatar
Good job on the tutorial. Just as a heads up, you need Java Development Kit (JDK) instead of normal java.
1
04/01/2015 7:35 pm
Level 34 : Artisan Creeper Hugger
QuickWhitt7
QuickWhitt7's Avatar
Fixed. Thank you for the heads up. Your feedback is truly appreciated.
1
04/01/2015 11:32 pm
Level 23 : Expert Modder
SirBlobman
SirBlobman's Avatar
No problem. I'm trying to learn how to mod, and I found your tutorial to be helpful. Hope you can add this:
"How to add an item with a texture"
"How to add blocks (with textures)"
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome