Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Preparing Minecraft Forge for Modding in 1.7.2


Binero
 Share

Recommended Posts

Introduction

To build your modifications, forge uses Gradle. Gradle is a tool which automates the compilation, deployment and dependencies of your project. Forge ships with it's own version of Gradle, so you don't have to install it yourself.

 

Getting Minecraft Forge

You can download Minecraft Forge from the official website: https://files.minecraftforge.net/. Different versions of Forge might have different features, and might work for different versions of Minecraft. All modifications must use a Forge copy matching their Minecraft version. Using a Forge copy meant to be used on a different version of Minecraft *will* crash your game, and might not even compile.

 

In most cases it is sufficient you download the *recommended* version of Forge. The latest version might contain bugs and in general should only be used when you are testing them out, or when you need specific features attached to those specific versions.

 

[*]go to the Minecraft Forge download website

[*]Download the source (src) version of the copy you want. You should end up with a single zip archive.

[*]Extract the archive.

 

Setting up the workspace

You first need to open a console in your Forge directory. On Windows this is done by shift-clicking on the directory and clicking "Open Command Window Here".

 

As mentioned before, Forge uses Gradle, which makes managing your project a whole lot easier. Forge ships with a Graddle wrapper. On Linux this is gradlew and on Windows this is gradlew.bat. If you have Grandle installed you can also simply use gradle.

 

To to setup your workspace and decompile Minecraft execute the following command:

gradle setupDecompWorkspace

If you do not have Gradle installed, you'll have to replace gradle with ./gradlew or gradlew.bat for Unix/Linux or Windows respectively.

 

Directory structure and files

You should now have the following directories:

  • build - Your mod can be found here once it's been built. It'll end up inside /libs.
  • eclipse - this is where the Eclipse IDE project will be located
  • gradle - the Gradle wrapper that ships with Forge
  • src - Your source files go here. Put your code inside /main/java, and your resources inside /main/resources
  • .gradle - Gralde's cache directory

 

mne1HrV.png

 

Building your modification

Once you have written your modification you can build it using the following command:

gradle build

Same goes here: If you do not have Gradle installed, you'll have to replace gradle with ./gradlew or gradlew.bat for Unix/Linux or Windows respectively.

 

Where to go next

Here are some more helpful tutorials:

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.