Hello there, I am making a modloader modding tutorial. Requirements for this tutorial: MCP
ModLoader
A fresh MC jar and server jar
Eclipse
JDK
JRE 6 or later(if MC runs you should be good)
Getting set up:
Ok, so what your gonna need to to is to extract an MCP workspace. First, see that folder named jars? Copy and paste a CLEAN bin folder in there with a minecraft.jar with ONLY ModLoader installed. You will also need a clean server.jar. Also copy a resources folder in there. After your done with all of this run the decompile.bat or.sh depending on your OS. If mac use .sh, if windows use .bat. Now install JDK and eclipse. Run eclipse and it should ask you to select your workspace. Select browse and find your MCP folder. Inside there should be an eclipse folder, select that as your workspace. You should be ready now
Now set up a path varible like so, btw I took the path varible park from jbond's tutorials, I give him COMPLETE credit for that part
Windows 7:
From the desktop, right click the Computer icon.
Choose Properties from the context menu.
Click the Advanced system settings link.
Click Environment Variables. In the section System Variables, find the PATH environment variable and select it. Click Edit. If the PATH environment variable does not exist, click New.
In the Edit System Variable (or New System Variable) window, specify the value of the PATH environment variable. Click OK. Close all remaining windows by clicking OK.
Starting your mod:
Ok, so now create a new class and name it mod_Yourmodname, Ill actually make a mod in this tutorial, so I'll name this mod mod_TutorialMod because I cant think of anything. Heres my mod_TutorialMod basic template:
package net.minecraft.src;
import java.util.Random;
public class mod_TutorialMod extends BaseMod
{
public void load()
{
}
public String getVersion()
{
return "1.3.2";
}
}
Rename mod_Tutorial to whatever the class name is, but it should ALWAYS start with mod_
MODDING TUTORIALS:
NEW BLOCK:
mod_TutoiralMod BEFORE WE ADD BLOCK
[/size][/size]
[size=small][size=medium]package net.minecraft.src;
import java.util.Random;
public class mod_TutorialMod extends BaseMod
{
public void load()
{
}
public String getVersion()
{
return "1.3.2";
}
Ok so first you gotta add this to the file:
public static final Block tutorialBlock = new BlockTutorialBlock(167, 0).setStepSound(Block.soundStoneFootstep).setBlockName("blockTutorial").setHardness(2F).setResistance(3F).setLightValue(1F);
CODE EXPLAINATION:
public static final Block tutorialBlock just declares it.
The number 167 is the block ID, 0 is just the icon index, dont worry, you'll override this later.
.setBlockName just gives it a nametag, if you dont have this MC will crash.
.setHardness just sets how hard it is, the higher it is the harder it would be to break.
.setResistance sets its resistance to TNT, the higher the harder it would be to blow up.
.setLightValue would set how it lights up, if you dont want it to light up just dont put it there.
.setStepSound sets what sound it makes when you step on it.
Now our mod_TutorialBlock looks like this:
package net.minecraft.src;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Random;
public class mod_TutorialMod extends BaseMod
{
public static final Block tutorialBlock = new BlockTutorialBlock(167, 0).setStepSound(Block.soundStoneFootstep).setBlockName("blockTutorial").setHardness(2F).setResistance(3F).setLightValue(1F);
public void load()
{
}
public String getVersion()
{
return "1.3.2";
}
}
Now you gotta add this RIGHT WHERE I SAY TO ADD IT IN FINAL CODE!:
registerBlock, well, registers the block. if you didnt add that it wouldnt be in game.
addName well adds the in game name of the block.
addOverrive adds the in game image, change randommod to the folder your image is in, randomblock2.png to the image name, Remember the .png!
Now we're done with that file. Notice the error on BlockTutorialBlock or whatever you called it? You need to create a class for it
Here's the code for BlockTutorialBlock:
package net.minecraft.src;
import java.util.Random;
public class BlockTutorialBlock extends Block
{
public BlockTutorialBlock(int par1, int par2)
{
super(par1, par2, Material.rock);
this.setCreativeTab(CreativeTabs.tabBlock);
}
public int quantityDropped(int par1)
{
return (1);
}
public int idDropped(int par1, Random par2Random, int par3)
{
return mod_TutorialMod.tutorialBlock.blockID;
}
}
MCP
ModLoader
A fresh MC jar and server jar
Eclipse
JDK
JRE 6 or later(if MC runs you should be good)
Getting set up:
Ok, so what your gonna need to to is to extract an MCP workspace. First, see that folder named jars? Copy and paste a CLEAN bin folder in there with a minecraft.jar with ONLY ModLoader installed. You will also need a clean server.jar. Also copy a resources folder in there. After your done with all of this run the decompile.bat or.sh depending on your OS. If mac use .sh, if windows use .bat. Now install JDK and eclipse. Run eclipse and it should ask you to select your workspace. Select browse and find your MCP folder. Inside there should be an eclipse folder, select that as your workspace. You should be ready now
Now set up a path varible like so, btw I took the path varible park from jbond's tutorials, I give him COMPLETE credit for that part
Starting your mod:
Ok, so now create a new class and name it mod_Yourmodname, Ill actually make a mod in this tutorial, so I'll name this mod mod_TutorialMod because I cant think of anything. Heres my mod_TutorialMod basic template:
Rename mod_Tutorial to whatever the class name is, but it should ALWAYS start with mod_
mod_TutoiralMod BEFORE WE ADD BLOCK
Ok so first you gotta add this to the file:
public static final Block tutorialBlock just declares it.
The number 167 is the block ID, 0 is just the icon index, dont worry, you'll override this later.
.setBlockName just gives it a nametag, if you dont have this MC will crash.
.setHardness just sets how hard it is, the higher it is the harder it would be to break.
.setResistance sets its resistance to TNT, the higher the harder it would be to blow up.
.setLightValue would set how it lights up, if you dont want it to light up just dont put it there.
.setStepSound sets what sound it makes when you step on it.
Now our mod_TutorialBlock looks like this:
Now you gotta add this RIGHT WHERE I SAY TO ADD IT IN FINAL CODE!:
registerBlock, well, registers the block. if you didnt add that it wouldnt be in game.
addName well adds the in game name of the block.
addOverrive adds the in game image, change randommod to the folder your image is in, randomblock2.png to the image name, Remember the .png!
Now we're done with that file. Notice the error on BlockTutorialBlock or whatever you called it? You need to create a class for it
Here's the code for BlockTutorialBlock:
MORE TUTORIALS TO COME LATER TODAY OR TOMORROW!
EDIT:LOL IM A FULL STACK
Hmm, Ill work on that
4 can be changed, but 4 makes it 2 hearts. Each number is 1/2 of a heart.