207
How To Make A Minecraft Mod
(no.2 [Adding a new block with custom texture])
THIS IS NOT THE SUPPORT PAGE! DO NOT COMMENT HERE IF YOU HAVE ANY QUESTIONS OR YOU NEED HELP!
requirements:
completed tutorial no.1
Paint.net
today i will show you how to make a new block in mincraft. you can make the block texture how ever you want it. for me i will be using my face:
when you make your block texture, make sure it is 16x16!
ok lets start!
TUTORIAL:
1.open eclipse and make sure that your work space is in your MCP folder and is selected on the eclipse folder in the MCP folder
2.create a new class called mod_MyNewBlock
3.fix your class so it looks like mine:
package net.minecraft.src;
public abstract class mod_MyNewBlock extends BaseMod
{
public mod_MyNewBlock()
{
}
public void load()
{
}
public String getVersion()
{
return "Fox_news mod Tutorial no.2";
}
static
{
}
}
4.ok now we are going to tell ModLoader to add a new block:
add this above public mod_MyNewBlock()
public static final Block newBlock;
5.in the public void load() add this
ModLoader.addName(newBlock, "Tutorial Block by fox_news");
ModLoader.registerBlock(newBlock);
newblock.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/foxface.png");
ModLoader.addRecipe(new ItemStack(newBlock, 4), new Object[]
{
"XXX", "XFX", "XXX", 'X', Item.ingotIron, 'F', Item.painting
});
*NOTE*: where you see "/foxface.png" , if you made a different texture with a different name make sure you change "/foxface.png" to "/what ever you named your texture.png"
5:2. in the static add this
newblock = (new BlockNew(175, Material.ground)).setBlockName("newblock").setStepSound(Block.soundMetalFootstep);
6.save the class and create another class called BlockNew
7.fix your class so it looks like mine:
package net.minecraft.src;
import java.util.ArrayList;
public class BlockNew extends Block
{
public BlockNew(int i, Material material)
{
super(i, material);
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
setLightOpacity(5);
}
public boolean renderAsNormalBlock()
{
return true;
}
public boolean isOpaqueCube()
{
return true;
}
}
8.save both files and go back to your MCP folder
9.open the jar folder
10.click on bin
11.right click on minecraft.jar
12.click open archive
13.if you didn't already, make a block texture or you can use the one above
14.drag the block texture called foxface.png (or what ever you called your texture) into the minecraft.jar
15.go back to your MCP folder and run recompile.bat
if you get any errors then you did somthing wrong, go back and check if everything is spelled right
16. run startclient.bat and use the crafting recipe to get your new block
17. go back to the MCP folder and go to the conf folder
18. open cleint.txt
19. press CTRL + A and delete everything there
20. save cleint.txt
21. go back to the MCP folder and run reobfuscate.bat
22. once that finishes go back to your MCP folder and open the reobf folder
23. open the minecraft folder
24. now what you see is your new mod ready for distrebution! on your desktop create a zip folder (name it what ever you want)
25. take those class files from the minecraft folder, drag and drop them into that zip folder you just made
26. you can now add them to your minecraft client or upload them to a website
27. CONGRATS! you just finished the new block tutorial!
Tags |
tools/tracking
812937
6
how-to-make-a-minecraft-mod-no2-adding-a-new-block-with-a-custom-texture
Create an account or sign in to comment.
Do I replace all of the "myNewBlock"s with "Refined Obsidian", or just "Tutorial Block by Fox_news"
sorry, i am not good at all with mods
(I'm not 100% sure, but I'm like 75% sure it would work...)
XXX
XFX
XXX