How to Make KillBlock for Minecraft 1.5.1
Ok First, you will need a few things.
-Risugami's Modloader( at the time i made this, i was using Version 1.5.1)
-Minecraft Coder Pac (MCP) ( at the time i made this, i was using Version 7.44)
-(not needed, but helpful) Eclipse Juno
Technically the only thing that you NEED to install this is Modloader(as i will provide a Dropbox link to the bin folder I have that has the mod already installed) But for all of you who would like to install it yourselves, like it to work with your other mods, or are having troubles with installing the bin folder, i will also provide the files that I made. There are 3 of them, and in order for them to work, you must name them exactly like this, and they are case sensitive.
BlockAwesome
ItemAwesome
mod_MyMod
The only way that the names of the files can be changed, is if you change the name in the files that declares it, and EVERY other reference to that file and name.
I will now provide the code for these in the order of 1.BlockAwesome 2.ItemAwesome 3.mod_MyMod and then continue on with the tutorial:
1. BlockAwesome
package net.minecraft.src;
import java.util.Random;
public class BlockAwesome extends Block{
protected BlockAwesome(int par1) {
super(par1, Material.rock);
this.setTickRandomly(true);
this.setCreativeTab(CreativeTabs.tabBlock);
}
public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
{
float var5 = 0.0625F;
return AxisAlignedBB.getAABBPool().getAABB((double)((float)par2 + var5), (double)par3, (double)((float)par4 + var5), (double)((float)(par2 + 1) - var5), (double)(par3 + 1), (double)((float)(par4 + 1) - var5));
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
{
float var5 = 0.0625F;
return AxisAlignedBB.getAABBPool().getAABB((double)((float)par2 + var5), (double)par3, (double)((float)par4 + var5), (double)((float)(par2 + 1) - var5), (double)((float)(par3 + 1) - var5), (double)((float)(par4 + 1) - var5));
}
public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity)
{
par5Entity.attackEntityFrom(DamageSource.cactus, 100);
}
public int idDropped(int par1, Random par2Random, int par3) {
return mod_MyMod.awesomeBlock.blockID;
}
public int quantityDroppedWithBonus(int par1, Random par2Random) {
return this.quantityDropped(par2Random) + par2Random.nextInt(par1 + 1);
}
}
2. ItemAwesome
package net.minecraft.src;
public class ItemAwesome extends Item {
protected ItemAwesome(int par1) {
super(par1);
setCreativeTab(CreativeTabs.tabMaterials);
}
}
3. mod_MyMod
package net.minecraft.src;
import java.util.Random;
public class mod_MyMod extends BaseMod {
public static final Block awesomeBlock = (new BlockAwesome(169)).setHardness(5.0F).setResistance(2000.0F).setLightValue(1.0F).getIndirectPowerOutput("awesomeBlock");
public static final Item awesomeItem = (new ItemAwesome(1690)).setUnlocalizedName("awesomeItem");
@Override
public String getVersion() {
return "MyMod V1.0";
}
@Override
public void load() {
register();
name();
crafting();
smelting();
}
public void register() {
ModLoader.registerBlock(awesomeBlock);
}
public void name() {
ModLoader.addName(awesomeBlock, "Awesome Block");
ModLoader.addName(awesomeItem, "Awesome Item");
}
public void crafting() {
ModLoader.addShapelessRecipe(new ItemStack(awesomeBlock,2), awesomeItem);
}
public void smelting () {
ModLoader.addSmelting(awesomeItem.itemID, new ItemStack(awesomeBlock,4), 1.0F);
}
public void generateSurface(World world, Random random, int i, int j){
for(int r=0;r<200;r++){
int x = 1 + random.nextInt(16);
int y = random.nextInt(128);
int z = 1 + random.nextInt(16);
new WorldGenMinable(awesomeBlock.blockID,12).generate(world, random, x, y, z);
}
}
public int addFuel(int i, int j){
if(i == awesomeBlock.blockID){
return 2000;
}else{
return 0;
}
}
}
Ok, lets' get started.
Assuming you have already installed Modloader, Eclipse, and MCP, you must now Open up Eclipse. In the package explorer you need to expand Client, then src, then net.minecraft.src. Create your 3 new files by either copying and pasting the text into them, or just writing them yourself. Like I said the files need to be named as specified at the start of this tutorial.
Once you have done this, you must exit out of Eclipse( not doing so will cause the decompiler to say something like - error occured permission denied) and now open up your MCP file ( It doesnt really matter what you have named this file, but it should be the file that has the files: .metadata, bin, conf, docs, eclipse, etc... And should also be where your Eclipse workspace is.) and click the recompile batch file. When that is done recompiling, then go back into MCP file and click on the reobsfucate batch ile and wait for that to finish. Now scroll up and open the reobsfucate FOLDER and in it should be a folder called minecraft, and in that should be ALL the files that you have modified.
Ok now this is what I did, not sure if it will work any other way, as I have not tried, but if you did and it worked, then let me know I went and copied the minecraft.jar from MCP/jars/bin folder, and then went into my Users/appdata/Roaming/.minecraft/bin folder, and replaced the minecraft.jar in that folder, with the one from the MCP/jars/bin folder. ( Also im not sure if this matters, but in my .minecraft/bin folder, there is not multiple minecraft.jar files, Example some people will have minecraft-1.4.7.jar and a minecraft-1.5.jar but I do not, and it was causing errors when I would try to run my mod with the other ones also in there.)
Then I took the 3 files that came out of the Reobsfucation folder, and copied them. Then I opened up the minecraft.jar file with winrar or whatever your using, and pasted all 3 files into it along with ALL the other class files. But I NEVER placed any of these files in the .minecraft/bin/mods folder, otherwise they will not work.
Last step, is to take the texture that you wish to place on this block, and put it in the minecraft.jar/textures/block folder with the name awesomeBlock.png and do the same for the item, but instead name it awesomeItem.png and make sure that awesome is not capitalized, but Block and Item are.
You should now be able to run minecraft and try it out, and if you get lost please either leave a comment, or even message me on here. AND if anyone knows whether or not it is safe to post a link to a copy of my bin file, let me know and i will post it immediately!! I just don't wanna post it if it has my account name/password or anything like that. Thanks! and enjoy
First of all this should of been a video.
Second of all i don't think this should be in the mod section.
Third of all what if they just want the mod and don't want to do all of this.
First of all this should of been a video.
Second of all i don't think this should be in the mod section.
Third of all what if they just want the mod and don't want to do all of this
Well I have been thinking of making this into a video, because it is a LOT to explain HAHA!! And if i do, i will post a link to it on here
It is in the Mod section because it is a MOD as it is MODIFYING the game from its original state
AND if you just wanted the MOD, then you can just copy and paste the CODE right out of the boxes and do it yourself
Ok First, you will need a few things.
-Risugami's Modloader( at the time i made this, i was using Version 1.5.1)
-Minecraft Coder Pac (MCP) ( at the time i made this, i was using Version 7.44)
-(not needed, but helpful) Eclipse Juno
Technically the only thing that you NEED to install this is Modloader(as i will provide a Dropbox link to the bin folder I have that has the mod already installed) But for all of you who would like to install it yourselves, like it to work with your other mods, or are having troubles with installing the bin folder, i will also provide the files that I made. There are 3 of them, and in order for them to work, you must name them exactly like this, and they are case sensitive.
BlockAwesome
ItemAwesome
mod_MyMod
The only way that the names of the files can be changed, is if you change the name in the files that declares it, and EVERY other reference to that file and name.
I will now provide the code for these in the order of 1.BlockAwesome 2.ItemAwesome 3.mod_MyMod and then continue on with the tutorial:
1. BlockAwesome
2. ItemAwesome
3. mod_MyMod
Ok, lets' get started.
Assuming you have already installed Modloader, Eclipse, and MCP, you must now Open up Eclipse. In the package explorer you need to expand Client, then src, then net.minecraft.src. Create your 3 new files by either copying and pasting the text into them, or just writing them yourself. Like I said the files need to be named as specified at the start of this tutorial.
Once you have done this, you must exit out of Eclipse( not doing so will cause the decompiler to say something like - error occured permission denied) and now open up your MCP file ( It doesnt really matter what you have named this file, but it should be the file that has the files: .metadata, bin, conf, docs, eclipse, etc... And should also be where your Eclipse workspace is.) and click the recompile batch file. When that is done recompiling, then go back into MCP file and click on the reobsfucate batch ile and wait for that to finish. Now scroll up and open the reobsfucate FOLDER and in it should be a folder called minecraft, and in that should be ALL the files that you have modified.
Ok now this is what I did, not sure if it will work any other way, as I have not tried, but if you did and it worked, then let me know I went and copied the minecraft.jar from MCP/jars/bin folder, and then went into my Users/appdata/Roaming/.minecraft/bin folder, and replaced the minecraft.jar in that folder, with the one from the MCP/jars/bin folder. ( Also im not sure if this matters, but in my .minecraft/bin folder, there is not multiple minecraft.jar files, Example some people will have minecraft-1.4.7.jar and a minecraft-1.5.jar but I do not, and it was causing errors when I would try to run my mod with the other ones also in there.)
Then I took the 3 files that came out of the Reobsfucation folder, and copied them. Then I opened up the minecraft.jar file with winrar or whatever your using, and pasted all 3 files into it along with ALL the other class files. But I NEVER placed any of these files in the .minecraft/bin/mods folder, otherwise they will not work.
Last step, is to take the texture that you wish to place on this block, and put it in the minecraft.jar/textures/block folder with the name awesomeBlock.png and do the same for the item, but instead name it awesomeItem.png and make sure that awesome is not capitalized, but Block and Item are.
You should now be able to run minecraft and try it out, and if you get lost please either leave a comment, or even message me on here. AND if anyone knows whether or not it is safe to post a link to a copy of my bin file, let me know and i will post it immediately!! I just don't wanna post it if it has my account name/password or anything like that. Thanks! and enjoy
Second of all i don't think this should be in the mod section.
Third of all what if they just want the mod and don't want to do all of this.
Click it!
Well I have been thinking of making this into a video, because it is a LOT to explain HAHA!! And if i do, i will post a link to it on here
It is in the Mod section because it is a MOD as it is MODIFYING the game from its original state
AND if you just wanted the MOD, then you can just copy and paste the CODE right out of the boxes and do it yourself