Hello!!! Hey if you haven't heard of me (probally a 90% chance) check me out on youtube. But this is about how to make a mod, it is really simple and I want to inspire people into it. It's not hard (or at least the basics) but don't ask me to do stuff like PhysicsCraft I have no idea how they do that, if you know how inform me. Some hard stuff I know is maybe nether generation and gravity for blocks. So... just explore this topic and I hope you like it.
Setting Up MCP
Video will be uploaded soon.
How To: Download each of these items, once you have extract and open MCP, then copy paste your bin folder into the jars folder of MCP, then open minecraft.jar with WinRAR or 7Zip (before doing this make sure it is unmodded) and drag everything from ModLoader to it, after doing this click decompile in MCP, it may take awhile, then you extract and open Eclipse, it can be in any place, for your workspace go into the eclipse folder of MCP then click Open. If you want to make another mod, follow the steps excluding the one with Eclipse, instead go to eclipse and change the workspace. If you have a problem then ask me in the comment section below.
//This is the public static final section, remember this.
public static final Block OreNameOfOre = new BlockNameOfOre(250, 0).setHardness(3.0F).setResistance(10.0F).setLightLevel(0.0F).setBlockName("BLABLABLA");
//The .setHardness makes it that hard, (ex: Iron = 3.0F or Obsidian 50.0F) .setResitance makes it that good at resisting explosions, (ex: Stone = 10.0F, Obsidian = 100.0F) .setLightLevel makes it that bright, this is useful in making radioactive ores, and then .setBlockName is kind of pointless it seems to have no use to the coding when I do it.
public static final Item NameOfOreDrop = new ItemNameOfOreDrop(2023).setItemName("BLABLA");
public void generateSurface(World world, Random random, int chunkX, int chunkZ)
{
Random randomGenerator = random;
for (int i = 0; i < 10; i++)
{
int randPosX = chunkX + randomGenerator.nextInt(20);
int randPosY = random.nextInt(40);
int randPosZ = chunkZ + randomGenerator.nextInt(20);
(new WorldGenMinable(oreNameOfOre.blockID, 4)).generate(world, random, randPosX, randPosY, randPosZ);
}
}
{
//The chunks are like how diamond spawns, 16-12, so you would have the first and last be 12, and the middle would be 16. And the WorldGenMinable(oreNameOfOre.blockID, right here would be its spawn rate.
public void load()
{
public mod_ModNameHere() {
//This is the ModLoader section, remember that too.
ModLoader.registerBlock("oreNameOfOre");
ModLoader.addName("oreNameOfOre", "In-Game Name Of Ore"); oreNameOfOre.blockIndexInTexture = ModLoader.addOverride("terrain.png", /textures/NameOfPictureWithOre.png");
//Make sure to have transparency in the picture and have the textures folder in minecraft.jar, same thing with the items.
ModLoader.addName("NameOfOreDrop", "In-Game Name Of Ore Drop"); NameOfOreDrop.iconIndex = ModLoader.addOverride("/gui/items.png", /textures/NameOfPictureWithOreDrop.png");
{
}
public String getVersion()
{
return "3.14159265";
}
}
public class BlockNameOfOre extends Block
{
protected BlockNameOfOre(int i, int j)
{
super(i, j, Material.iron);
}
public int idDropped(int par1, Random par2Random, int par3)
{
return mod_NameOfMod.NameOfOreDrop.itemID;
}
public int quantityDropped(Random random)
{
return 1;
}
public String Version()
{
return "3.14159265";
}
}
Hey if you haven't heard of me (probally a 90% chance) check me out on youtube. But this is about how to make a mod, it is really simple and I want to inspire people into it. It's not hard (or at least the basics) but don't ask me to do stuff like PhysicsCraft I have no idea how they do that, if you know how inform me. Some hard stuff I know is maybe nether generation and gravity for blocks. So... just explore this topic and I hope you like it.
Setting Up MCP
Video will be uploaded soon.
How To:
Download each of these items, once you have extract and open MCP, then copy paste your bin folder into the jars folder of MCP, then open minecraft.jar with WinRAR or 7Zip (before doing this make sure it is unmodded) and drag everything from ModLoader to it, after doing this click decompile in MCP, it may take awhile, then you extract and open Eclipse, it can be in any place, for your workspace go into the eclipse folder of MCP then click Open. If you want to make another mod, follow the steps excluding the one with Eclipse, instead go to eclipse and change the workspace. If you have a problem then ask me in the comment section below.
Links you need:
Eclipse: http://www.eclipse.o...sic-421/junosr1
Modloader: http://www.minecraft...s-mods-updated/
MCP:http://mcp.ocean-labs.de/index.php/MCP_Releases
Starting The mod_ File and an Ore
Video will be uploaded soon.
Source Code:
mod_ModNameHere
package net.minecraft.src;
import java.util.Random;
public class mod_ModNameHere extends BaseMod
{
//This is the public static final section, remember this.
public static final Block OreNameOfOre = new BlockNameOfOre(250, 0).setHardness(3.0F).setResistance(10.0F).setLightLevel(0.0F).setBlockName("BLABLABLA");
//The .setHardness makes it that hard, (ex: Iron = 3.0F or Obsidian 50.0F) .setResitance makes it that good at resisting explosions, (ex: Stone = 10.0F, Obsidian = 100.0F) .setLightLevel makes it that bright, this is useful in making radioactive ores, and then .setBlockName is kind of pointless it seems to have no use to the coding when I do it.
public static final Item NameOfOreDrop = new ItemNameOfOreDrop(2023).setItemName("BLABLA");
public void generateSurface(World world, Random random, int chunkX, int chunkZ)
{
Random randomGenerator = random;
for (int i = 0; i < 10; i++)
{
int randPosX = chunkX + randomGenerator.nextInt(20);
int randPosY = random.nextInt(40);
int randPosZ = chunkZ + randomGenerator.nextInt(20);
(new WorldGenMinable(oreNameOfOre.blockID, 4)).generate(world, random, randPosX, randPosY, randPosZ);
}
}
{
//The chunks are like how diamond spawns, 16-12, so you would have the first and last be 12, and the middle would be 16. And the WorldGenMinable(oreNameOfOre.blockID, right here would be its spawn rate.
public void load()
{
public mod_ModNameHere() {
//This is the ModLoader section, remember that too.
ModLoader.registerBlock("oreNameOfOre");
ModLoader.addName("oreNameOfOre", "In-Game Name Of Ore");
oreNameOfOre.blockIndexInTexture = ModLoader.addOverride("terrain.png", /textures/NameOfPictureWithOre.png");
//Make sure to have transparency in the picture and have the textures folder in minecraft.jar, same thing with the items.
ModLoader.addName("NameOfOreDrop", "In-Game Name Of Ore Drop");
NameOfOreDrop.iconIndex = ModLoader.addOverride("/gui/items.png", /textures/NameOfPictureWithOreDrop.png");
{
}
public String getVersion()
{
return "3.14159265";
}
}
BlockNameOfOre
package net.minecraft.src;
import java.util.Random;
public class BlockNameOfOre extends Block
{
protected BlockNameOfOre(int i, int j)
{
super(i, j, Material.iron);
}
public int idDropped(int par1, Random par2Random, int par3)
{
return mod_NameOfMod.NameOfOreDrop.itemID;
}
public int quantityDropped(Random random)
{
return 1;
}
public String Version()
{
return "3.14159265";
}
}
ItemNameOfOreDrop
package net.minecraft.src;
import java.util.Random;
public class ItemNameOfOreDrop extends Item
{
public ItemNameOfOreDrop(int i)
{
super(i);
maxStackSize = 64;
}
public String Version()
{
return "3.14159265";
}
}
Really simple if you have any questions ask in the comment section below.