Okay, so im not an expert modder, i have made some simple, but useful mods and i have made some complex, but pointless mods. These are NOT tutorials on how to make mod loader mods, so if that's why your here then just leave right now!
soo lets get on to the tutorials, shall we?
Setting up:
This is not as hard as many people say.. on my OS i don't have to set up the path variables IDK about you guys but thats how im going to teach.
1: Download and install the latest verison of Java JDK i'm using verison 6.26, version 6 update 26, which can be found here
2:(optional) download eclipse, i'm not going to explain how to set it up because i don't use it to mod.
3: download the latest version of MCP which you can find here extract it to a folder called "MCP" or whatever else you want to name it
4:On your keyboard (windows 0S) type "Windows button + R" then type %appdata% , open up roaming, then .minecraft, make sure you have a clean version of minecraft, and copy the resource folder and the bin folder. After you have copied The bin and resource folders go to MCP->Jars and paste them in there.
5: after step four, go back to MCP and run "decompile" if done correctly, you should get no errors and your done setting up mcp!
Adding a new block to the game
Difficulty: 2/10
You really require no prior knowledge in java.
Go to MCP->src->minecraft->net->minecraft->src
You should see alot of different .java files
the only ones that we need to worry about are: Block.java, craftingManager.java, and blockDirt.java
First, you will need to copy this code
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) braces deadcode
package net.minecraft.src;
// Referenced classes of package net.minecraft.src:
// Block, Material
public class Block glowBlock extends Block //The block is going to be called glowBlock, replace it with anything
{
protected Block glowBlock(int i, int j)
{
super(i, j, Material.ground);
}
}
Copy that paste it into a file called BlockGlowBlock.java or what ever you named your block. Then we will need to open block.java, then scroll down about 3 quarters of the way down untill you see a bunch of lines of code that say:
public static final Block <blockname>;
we are going to add one of those that say
public static final Block glowBlock;
after that save your progress and scroll down to untill you find a a line of code that says this
trapdoor = (new BlockTrapDoor(96, Material.wood)).setHardness(3F).setStepSound(soundWoodFootstep).setBlockName("trapdoor").disableStats().disableNeighborNotifyOnMetadataChange();
Then go under that and type
glowBlock = (new BlockGlowBlock(97, 30)).setHardness(0.3F).setStepSound(soundStoneFootstep).setLightValue(1.0F).setBlockName("glowBlock");
Now lets look into this code shall we? where it says (new BlockGlowBlock(97, 30)) 97 is the block id, 96 is the latest block id in vannila minecraft, so 97 would be the next available block id (herp derp) and 30 is the number on the grid for the textures which i will explain later. what soundStoneFootstep means is when you step on the block, it will sound like stone. setHardness(0.3F) means that the block will be pretty easy to break. and finally,
setLightValue(1.0) is how much it will glow, im pretty sure 1.0 is the highest you can go.
for the texture grid open MCP->temp->bin->minecraft->terrain.png
it looks like this as of Beta 1.7.3
the grid counts off like 0, 1, 2, 3, 4, 5 ect and the first open spot is 30, which i have circled is what your going to edit so edit that how ever you please. next, we are going to make a crafting recipe for the new block we just made so open up craftingmanager.java and at the end of the list, type this
to make the new block, you put four dirt into the crafting square, and when you make the recipe, you get 16 dirt
save all of your progress, go to mcp and run recompile you should get no errors. to test your mod run start client and when you go and collect 4 dirt and put it in the crafting square, you should get 4 glowblock.
So other people can play your mod, run reobfuscate then, open the reobf folder, then minecraft want those are the files you use!
soo lets get on to the tutorials, shall we?
Setting up:
This is not as hard as many people say.. on my OS i don't have to set up the path variables IDK about you guys but thats how im going to teach.
1: Download and install the latest verison of Java JDK i'm using verison 6.26, version 6 update 26, which can be found here
2:(optional) download eclipse, i'm not going to explain how to set it up because i don't use it to mod.
3: download the latest version of MCP which you can find here extract it to a folder called "MCP" or whatever else you want to name it
4:On your keyboard (windows 0S) type "Windows button + R" then type %appdata% , open up roaming, then .minecraft, make sure you have a clean version of minecraft, and copy the resource folder and the bin folder. After you have copied The bin and resource folders go to MCP->Jars and paste them in there.
5: after step four, go back to MCP and run "decompile" if done correctly, you should get no errors and your done setting up mcp!
Adding a new block to the game
Difficulty: 2/10
You really require no prior knowledge in java.
Go to MCP->src->minecraft->net->minecraft->src
You should see alot of different .java files
the only ones that we need to worry about are: Block.java, craftingManager.java, and blockDirt.java
First, you will need to copy this code
Copy that paste it into a file called BlockGlowBlock.java or what ever you named your block. Then we will need to open block.java, then scroll down about 3 quarters of the way down untill you see a bunch of lines of code that say:
public static final Block <blockname>;
we are going to add one of those that say
public static final Block glowBlock;
after that save your progress and scroll down to untill you find a a line of code that says this
trapdoor = (new BlockTrapDoor(96, Material.wood)).setHardness(3F).setStepSound(soundWoodFootstep).setBlockName("trapdoor").disableStats().disableNeighborNotifyOnMetadataChange();
Then go under that and type
Now lets look into this code shall we? where it says (new BlockGlowBlock(97, 30)) 97 is the block id, 96 is the latest block id in vannila minecraft, so 97 would be the next available block id (herp derp) and 30 is the number on the grid for the textures which i will explain later. what soundStoneFootstep means is when you step on the block, it will sound like stone. setHardness(0.3F) means that the block will be pretty easy to break. and finally,
setLightValue(1.0) is how much it will glow, im pretty sure 1.0 is the highest you can go.
for the texture grid open MCP->temp->bin->minecraft->terrain.png
it looks like this as of Beta 1.7.3
the grid counts off like 0, 1, 2, 3, 4, 5 ect and the first open spot is 30, which i have circled is what your going to edit so edit that how ever you please. next, we are going to make a crafting recipe for the new block we just made so open up craftingmanager.java and at the end of the list, type this
to make the new block, you put four dirt into the crafting square, and when you make the recipe, you get 16 dirt
save all of your progress, go to mcp and run recompile you should get no errors. to test your mod run start client and when you go and collect 4 dirt and put it in the crafting square, you should get 4 glowblock.
So other people can play your mod, run reobfuscate then, open the reobf folder, then minecraft want those are the files you use!
By: NickR
I like it.
thanks
By: NickR
what does the error say?
By: NickR
Mine says the system cannot path specefied when decompileing
By: NickR