10

How to make a mod! [1.5.2] [Modloader] Tutorial by KendogHD

  • 8,101
    Views, 8 today
  • 21 Comments
  • 5 Favorites
  • Flag / Report

Get Embed Code

Forum:
HTML:
Link:
avatar
KendogHD
Level 59 : Grandmaster Programmer
Hello PMC!

My name is Ryan aka Kendog and i love making mods! all the time, but sometimes i get people coming to me really wanting to make mods of their own, but dont know how to. But yet again Jeb has changed the Minecraft code and the way it works, so it was really hard for modders to update their mods!

But im here to teach you people, how to make a Minecraft Mod with Modloader for 1.5.2...

Enjoy!

NOTE : All you need to download is Java Eclipse and MCP. Links will be at the bottom of the post!

Setting up!
Once you have downloaded the required programs and files, then you must get a clean minecraft.jar, if you dont have a clean jar i suggest backing your mods up otherwise you will lose them. if its not clean just force update. then, Open MCP, Copy your Bin and Reasources folders from your .minecraft into the MCP Folder called Jars. Once done that, double click the batch file called decompile. let it run. Once it is done press enter and then open Java Eclipse. You should get a screen where it says you have to select a workspace. put the workspace as your Eclipse folder in MCP then click ok. Once fully loaded up, look at the top left and you should see two folders, Client and Server. there should be a little arrow next to the Client and make sure you click that. it will drop down a src folder click on that arrow. Then, right click the arrow on the folder that says net.minecraft.src . then you should get a whole heep of files. go onto the next part of the tutorial. 'Adding a Base'

Adding your Base for your mod!
Once you have got up to setting up part, here is the next part...

Hover over the net.minecraft.src at the top and right click on your mouse. it should bring a drop down menu. After this, hover over new and click Class. Dont touch anything but the name, put it whatever you want but you must have this infront... 'mod_Whatever' mod_, thats what you need. Then click finish. It should load up a screen on the right in there you should see a little piece of code. replace that code with the following....

Code :

package net.minecraft.src;
import java.util.Random;

public class mod_NAME extends BaseMod
{

public void load()
{

}
public String getVersion()
{
return "1.5/1.5.1";
}
}
Then move onto the adding a item part...

Adding your first Item!
with the piece of code, paste this other code under public class....

public static final Item NAMEhere = new ItemWhatever(2085).setUnlocalizedName("NAMEOFITEMINFOLDER").setCreativeTab(CreativeTabs.tabMaterials);

Paste this piece of code under public void load....

ModLoader.addName(NAMEhere, "Ingame -Name");

Make a new Class called ItemWhatever (whatever you can change)

Paste this code in the ItemWhatever...

package net.minecraft.src;
import java.util.Random;

public class ItemWhatever extends Item
{
public ItemWhatever(int i)
{
super(i);
maxStackSize = 64;
}

public String Version()
{
return "1.5/1.5.1";
}
}

Adding a Block

Paste this code under Public Class....

public static final Block NAMEBlock = new BlockWhatever(160, 0).setCreativeTab(CreativeTabs.tabBlock).setHardness(5F).setResistance(6F).setStepSound(Block.soundStoneFootStep).getIndirectPowerOutput("NAMEOFBLOCKINFOLDER");

Paste these pieces of code under Public Void Load...

ModLoader.registerBlock(NAMEBlock);ModLoader.addName(NAMEBlock, "In-game Name");
Make a new Class and Paste this code in...

package net.minecraft.src;
import java.util.Random;

public class BlockWhatever extends Block
{
public BlockSWhatever(int par1, int i)
{
super(par1, Material.rock);
this.setCreativeTab(CreativeTabs.tabBlock);
}

public int idDropped(int i, Random random, int j)
{
return mod_NAME.NAMEBLOCK.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}
}

Adding Tools
Put these in the Public Class section....

public static final Item Pickaxe = new ItemPickaxe(2107, EnumToolMaterial.GOLD).setUnlocalizedName("NAMEOFITEMINFOLDER");

public static final Item SHOVEL = new ItemSpade(2108, EnumToolMaterial.GOLD).setUnlocalizedName("NAMEOFITEMINFOLDER");

public static final Item H = new ItemHoe(2109, EnumToolMaterial.GOLD).setUnlocalizedName("NAMEOFITEMINFOLDER");

public static final Item SS = new ItemSword(2110, EnumToolMaterial.GOLD).setUnlocalizedName("NAMEOFITEMINFOLDER");

public static final Item A = new ItemAxe(2111, EnumToolMaterial.GOLD).setUnlocalizedName("NAMEOFITEMINFOLDER");

Put these codes under Public Void....

ModLoader.addName(Pickaxe, "BlackPickaxe");
ModLoader.addRecipe(new ItemStack(Pickaxe, 1), new Object[]
{
"***", " X ", " X ",
'X', Item.stick, '*', ITEM
});

ModLoader.addName(SHOVEL, "BlackShovel");
ModLoader.addRecipe(new ItemStack(SHOVEL, 1), new Object[]
{
" * ", " X ", " X ",
'X', Item.stick, '*', ITEM
});

ModLoader.addName(H, "BlackHoe");
ModLoader.addRecipe(new ItemStack(H, 1), new Object[]
{
"** ", " X ", " X ",
'X', Item.stick, '*', ITEM
});

ModLoader.addName(SS, "BlackSword");
ModLoader.addRecipe(new ItemStack(SS, 1), new Object[]
{
" * ", " * ", " X ",
'X', Item.stick, '*', ITEM
});

ModLoader.addName(A, "BlackAxe");
ModLoader.addRecipe(new ItemStack(A, 1), new Object[]
{
"** ", "*X ", " X ",
'X', Item.stick, '*', ITEM
});
Tags:Tutorial, How To, How, Make, Mod, For, Minecraft, Modloader 151, Modloader, 151
Credit:Kendog

More Blogs by KendogHDView All

Posted 2014-04-05 14:09:05
by KendogHD

Comments :

Join us to post comments.

1 - 21 of 21

GabeC_03
Level 1
New Miner
March 14, 2014, 12:03 am

I think he has a apple computer IDW there is NO arrows beside the Clinets folder!!!!

francismark
Level 1
New Miner
February 16, 2014, 3:19 am

nosebleeding :(

Skyfir34
Level 1
New Miner
June 21, 2013, 11:13 am

Should textures in 1.5.2 be examlpe:

public void setTextures()
{
SteelPickaxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/SteelPickaxe.png");
SteelAxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/SteelAxe.png");
SteelShovel.iconIndex = ModLoader.addOverride("/gui/items.png", "/SteelShovel.png");
SteelSword.iconIndex = ModLoader.addOverride("/gui/items.png", "/SteelSword.png");
SteelHoe.iconIndex = ModLoader.addOverride("/gui/items.png", "/SteelHoe.png");
SteelINgot.iconIndex = ModLoader.addOverrida("gui/items.png", "/SteelIngot.png");
}

I am learning so don't know if this is right.

LinkSword902
Level 6
Apprentice Explorer
July 20, 2013, 12:35 am

the setunlocalizedName is now the new texture thing, the way he is doing it is for 1.5.2, the way you were doing it WAS right until the next update happend hope this helped :D

Skyfir34
Level 1
New Miner
June 21, 2013, 11:06 am

[size=11px][color=rgb(102,102,0)]Can you add Textures?

[/color][/size]

KendogHD
Level 59
Grandmaster Programmer
June 21, 2013, 11:09 am

yes the code would be .setUnlocalizedName("nameoftexture"); for items put the texture in the items folder in the textures folder in your minecraft.jar in mcp. and for blocks just do the same but in the blocks folder

Skyfir34
Level 1
New Miner
June 21, 2013, 10:45 am

Can you give me a example of ("NAMEOFITEMFOLDER")?

KendogHD
Level 59
Grandmaster Programmer
June 21, 2013, 11:03 am

erm ("emeraldpick") for a emerald mod.

Addisoncugini12
Level 1
New Miner
May 18, 2013, 5:35 pm

HOW DO I DO IT WITH FORGE?!?!?!? and for minecraft 1.2.5 cuz I play tekkit classic, and MCP WILL NOT WORK!!!! I GOOGLES UP HOW TO CREATE A MINECRAFT MOD WITHOUT MCP AND THIS APPEARED WHAT IF YOUR PROBLEM?!?

Project_06
Level 1
New Miner
May 17, 2013, 9:32 pm

It would appear there arent any download links, and i dont know which Eclipse for Java i need...

KendogHD
Level 59
Grandmaster Programmer
May 20, 2013, 5:54 am

i will add them in

finneding
Level 1
New Miner
May 12, 2013, 2:14 am

bei mir läd der modloader nach dem reobfuscating den mod nicht ?!

KendogHD
Level 59
Grandmaster Programmer
May 12, 2013, 9:20 am

Leider habe ich nicht sprechen Deutsch

AlphaWolf918
Level 1
New Explorer
April 26, 2013, 12:50 pm

So, when I make a new block, is there a special kind of code I need to enter into one of the files, or do I just create a texture with the same name and put it in appropriately? Sorry, new to this, making sure I understand haha.

manster890
Level 22
Expert Taco
April 22, 2013, 11:36 pm

where are the links

CirrusLK
Level 5
Apprentice Explorer
April 10, 2013, 7:09 pm

What about the textures? Also, in the mod_ItemWhatever, (I renamed it but still) it want to rename public class ItemWhatever to mod_ItemWhatever so it has it's own file. Should I let it do that?

KendogHD
Level 59
Grandmaster Programmer
April 10, 2013, 7:12 pm

no, make a class called mod_whatever then make a separate file called ItemWhatever with the code in my item tutorial above.

CirrusLK
Level 5
Apprentice Explorer
April 11, 2013, 3:13 pm

No mod_? Also, this is a great tutorial but do you think you can explain what the different parts of code do?

Robbe1997
Level 1
New Miner
April 6, 2013, 1:01 pm

Hey man, great tutorial! really structural and easy to follow :D Still got a question though. When I typ for example "Potato" in the place you have to put the itemfolder, and then I make an image called Potato and put it in minecraft.jar/textures/items it still doesn't give me the texture. When I try to do it in pre-made mods from other people it works though. So do you need to link something with the texture folder first? I'm stuck here man D:

KendogHD
Level 59
Grandmaster Programmer
April 6, 2013, 1:06 pm

[size=10pt]Well in mcp you goto Jars, Bin, Minecraft.jar open it and go into the textures and put it in items. btw there is already a potato in minecraft. maybe it has overriden your mod with the regular one? make a random test one. and name it exactly as you did in the code also where it says [/size][size=12px]setUnlocalisedName("PUT HERE LIKE TEST AND NAME IT EXACTLY WITH THE PICTURE YOU PUT IN THE ITEMS FOLDER"); [/size]

[size=12px]make sure you get back to me if you need more help :)[/size]

[size=12px]Thanks [/size]

Robbe1997
Level 1
New Miner
April 6, 2013, 4:45 pm

Oh yeah, well potato was just an example that came in my head xD I tries it with alot of different things and it just wo'nt load :/

1 - 21 of 21