Mrgreen33gamer's [1.6.1\1.6.2\1.6.4\]Forge/ModLoader Modding Tutorials
Poll: Is helpful
Ended Feb 16, 2015
Poll: Do you want to make Bukkit Plugins
Ended Feb 16, 2015
Poll: Forge Dimension?
Ended Feb 16, 2015
Ended Feb 16, 2015
Ended Feb 16, 2015
Ended Feb 16, 2015
-
View User Profile
-
View Posts
-
Send Message
Curse Premium-
View User Profile
-
View Posts
-
Send Message
Curse Premiumummm, thats a little to much but i have nothing else to do all day, this is a pretty long code so i'll need extra support for this one...
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumUm, the part that says "2013, MyDisk" the MyDisk is the name of the music like, MyDisk.ogg
in your case change the MyDisk to bleed.ogg
Hope it helped.
Slab and stairs will be a SNAP!
NetherGenMinale
package net.minecraft.src; import java.util.Random; public class NetherGenMinable extends WorldGenerator { /** The block ID of the ore to be placed using this generator. */ private int minableBlockId; /** The number of blocks to generate. */ private int numberOfBlocks; public NetherGenMinable(int par1, int par2) { this.minableBlockId = par1; this.numberOfBlocks = par2; } public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) { float var6 = par2Random.nextFloat() * (float)Math.PI; double var7 = (double)((float)(par3 + 8) + MathHelper.sin(var6) * (float)this.numberOfBlocks / 8.0F); double var9 = (double)((float)(par3 + 8) - MathHelper.sin(var6) * (float)this.numberOfBlocks / 8.0F); double var11 = (double)((float)(par5 + 8) + MathHelper.cos(var6) * (float)this.numberOfBlocks / 8.0F); double var13 = (double)((float)(par5 + 8) - MathHelper.cos(var6) * (float)this.numberOfBlocks / 8.0F); double var15 = (double)(par4 + par2Random.nextInt(3) - 2); double var17 = (double)(par4 + par2Random.nextInt(3) - 2); for (int var19 = 0; var19 <= this.numberOfBlocks; ++var19) { double var20 = var7 + (var9 - var7) * (double)var19 / (double)this.numberOfBlocks; double var22 = var15 + (var17 - var15) * (double)var19 / (double)this.numberOfBlocks; double var24 = var11 + (var13 - var11) * (double)var19 / (double)this.numberOfBlocks; double var26 = par2Random.nextDouble() * (double)this.numberOfBlocks / 16.0D; double var28 = (double)(MathHelper.sin((float)var19 * (float)Math.PI / (float)this.numberOfBlocks) + 1.0F) * var26 + 1.0D; double var30 = (double)(MathHelper.sin((float)var19 * (float)Math.PI / (float)this.numberOfBlocks) + 1.0F) * var26 + 1.0D; int var32 = MathHelper.floor_double(var20 - var28 / 2.0D); int var33 = MathHelper.floor_double(var22 - var30 / 2.0D); int var34 = MathHelper.floor_double(var24 - var28 / 2.0D); int var35 = MathHelper.floor_double(var20 + var28 / 2.0D); int var36 = MathHelper.floor_double(var22 + var30 / 2.0D); int var37 = MathHelper.floor_double(var24 + var28 / 2.0D); for (int var38 = var32; var38 <= var35; ++var38) { double var39 = ((double)var38 + 0.5D - var20) / (var28 / 2.0D); if (var39 * var39 < 1.0D) { for (int var41 = var33; var41 <= var36; ++var41) { double var42 = ((double)var41 + 0.5D - var22) / (var30 / 2.0D); if (var39 * var39 + var42 * var42 < 1.0D) { for (int var44 = var34; var44 <= var37; ++var44) { double var45 = ((double)var44 + 0.5D - var24) / (var28 / 2.0D); if (var39 * var39 + var42 * var42 + var45 * var45 < 1.0D && par1World.getBlockId(var38, var41, var44) == Block.netherrack.blockID) { par1World.setBlock(var38, var41, var44, this.minableBlockId); } } } } } } } return true; } }Generation code in mod_
public void generateNether(World var1, Random var2, int var3, int var4) { int var5; int var6; int var7; int var8; int veinsize=8;//the veinsize of the ore not sure it works int rarity=12;//the rarity of the ore for (var5 = 0; var5 < rarity; ++var5) { var6 = var3 + var2.nextInt(16); var7 = var2.nextInt(128); var8 = var4 + var2.nextInt(16); new NetherGenMinable(NetherCoalBlock.blockID, veinsize).generate(var1, var2, var6, var7, var8); } }Again edit to your mod
THE REPORT:
THE CODE:
mod_Boogatite
package net.minecraft.src; import java.util.Random; public class mod_Boogatite extends BaseMod{ public static final Item Boogatite = new ItemBoogatite(2085).setUnlocalizedName("Boogatite").setCreativeTab(CreativeTabs.tabMaterials); public static final Block BoogatiteOre = new BlockBoogatiteOre(160, 0).setCreativeTab(CreativeTabs.tabBlock).setHardness(5F).setResistance(6F).setStepSound(Block.soundStoneFootstep).getIndirectPowerOutput("BoogatiteOre"); public static final Block BoogatiteBlock = new BlockBoogatiteBlock(161, 0).setCreativeTab(CreativeTabs.tabBlock).setHardness(5F).setResistance(6F).setStepSound(Block.soundMetalFootstep).getIndirectPowerOutput("BoogatiteBlock"); public static final Item BoogatiteBody = (new ItemArmor(2087, EnumArmorMaterial.BOOGATITE, 5, 1).setUnlocalizedName("BoogatiteChestplate").setCreativeTab(CreativeTabs.tabCombat)); public static final Item BoogatiteHelmet = (new ItemArmor(2086, EnumArmorMaterial.BOOGATITE, 5, 0).setUnlocalizedName("BoogatiteHelmet").setCreativeTab(CreativeTabs.tabCombat)); public static final Item BoogatiteLegs = (new ItemArmor(2088, EnumArmorMaterial.BOOGATITE, 5, 2).setUnlocalizedName("BoogatiteLeggings").setCreativeTab(CreativeTabs.tabCombat)); public static final Item BoogatiteBoots = (new ItemArmor(2089, EnumArmorMaterial.BOOGATITE, 5, 3).setUnlocalizedName("BoogatiteBoots").setCreativeTab(CreativeTabs.tabCombat)); public static final Item BoogatitePickaxe = new ItemPickaxe(2090, EnumToolMaterial.BOOGATITE).setUnlocalizedName("BoogatitePickaxe").setCreativeTab(CreativeTabs.tabCombat); public static final Item BoogatiteAxe = new ItemPickaxe(2091, EnumToolMaterial.BOOGATITE).setUnlocalizedName("BoogatiteAxe").setCreativeTab(CreativeTabs.tabCombat); public static final Item BoogatiteSpade = new ItemPickaxe(2092, EnumToolMaterial.BOOGATITE).setUnlocalizedName("BoogatiteShovel").setCreativeTab(CreativeTabs.tabCombat); public static final Item BoogatiteSword = new ItemPickaxe(2093, EnumToolMaterial.BOOGATITE).setUnlocalizedName("BoogatiteSword").setCreativeTab(CreativeTabs.tabCombat); public static final Item BoogatiteHoe = new ItemPickaxe(2094, EnumToolMaterial.BOOGATITE).setUnlocalizedName("BoogatiteHoe").setCreativeTab(CreativeTabs.tabCombat); public void load(){ ModLoader.addName(Boogatite, "Boogatite"); ModLoader.registerBlock(BoogatiteOre); ModLoader.addName(BoogatiteOre, "Boogatite Ore"); ModLoader.registerBlock(BoogatiteBlock); ModLoader.addName(BoogatiteBlock, "Block of Boogatite"); ModLoader.addRecipe(new ItemStack(BoogatiteBlock, 1), new Object[]{ "***", "***", "***", Character.valueOf('*'), mod_Boogatite.Boogatite.itemID }); ModLoader.addName(BoogatiteBody, "Boogatite Chestplate"); ModLoader.addName(BoogatiteHelmet, "Boogatite Helmet"); ModLoader.addName(BoogatiteLegs, "Boogatite Leggings"); ModLoader.addName(BoogatiteBoots, "Boogatite Boots"); ModLoader.addRecipe(new ItemStack(BoogatiteBody, 1), new Object[]{ "* *", "***", "***", Character.valueOf('*'), Boogatite.itemID }); ModLoader.addRecipe(new ItemStack(BoogatiteHelmet, 1), new Object[]{ "***", "* *", Character.valueOf('*'), Boogatite.itemID }); ModLoader.addRecipe(new ItemStack(BoogatiteLegs, 1), new Object[]{ "***", "* *", "* *", Character.valueOf('*'), Boogatite.itemID }); ModLoader.addRecipe(new ItemStack(BoogatiteBoots, 1), new Object[]{ "* *", "* *", Character.valueOf('*'), Boogatite.itemID }); ModLoader.addArmor("boogatite_"); ModLoader.addName(BoogatitePickaxe, "Boogatite Pickaxe"); ModLoader.addName(BoogatiteAxe, "Boogatite Axe"); ModLoader.addName(BoogatiteSpade, "Boogatite Shovel"); ModLoader.addName(BoogatiteSword, "Boogatite Sword"); ModLoader.addName(BoogatiteHoe, "Boogatite Hoe"); ModLoader.addRecipe(new ItemStack(BoogatitePickaxe, 1), new Object[]{ "***", " | ", " | ", Character.valueOf('*'), mod_Boogatite.Boogatite.itemID, Character.valueOf('|'), Item.stick.itemID }); ModLoader.addRecipe(new ItemStack(BoogatiteAxe, 1), new Object[]{ "** ", "*| ", " | ", Character.valueOf('*'), mod_Boogatite.Boogatite.itemID, Character.valueOf('|'), Item.stick.itemID }); ModLoader.addRecipe(new ItemStack(BoogatiteAxe, 1), new Object[]{ " **", " |*", " | ", Character.valueOf('*'), mod_Boogatite.Boogatite.itemID, Character.valueOf('|'), Item.stick.itemID }); ModLoader.addRecipe(new ItemStack(BoogatiteAxe, 1), new Object[]{ "** ", "|* ", " | ", Character.valueOf('*'), mod_Boogatite.Boogatite.itemID, Character.valueOf('|'), Item.stick.itemID }); ModLoader.addRecipe(new ItemStack(BoogatiteAxe, 1), new Object[]{ " **", " *|", " | ", Character.valueOf('*'), mod_Boogatite.Boogatite.itemID, Character.valueOf('|'), Item.stick.itemID }); ModLoader.addRecipe(new ItemStack(BoogatiteSpade, 1), new Object[]{ " * ", " | ", " | ", Character.valueOf('*'), mod_Boogatite.Boogatite.itemID, Character.valueOf('|'), Item.stick.itemID }); ModLoader.addRecipe(new ItemStack(BoogatiteSpade, 1), new Object[]{ "* ", "| ", "| ", Character.valueOf('*'), mod_Boogatite.Boogatite.itemID, Character.valueOf('|'), Item.stick.itemID }); ModLoader.addRecipe(new ItemStack(BoogatiteSpade, 1), new Object[]{ " *", " |", " |", Character.valueOf('*'), mod_Boogatite.Boogatite.itemID, Character.valueOf('|'), Item.stick.itemID }); ModLoader.addRecipe(new ItemStack(BoogatiteSword, 1), new Object[]{ " * ", " * ", " | ", Character.valueOf('*'), mod_Boogatite.Boogatite.itemID, Character.valueOf('|'), Item.stick.itemID }); ModLoader.addRecipe(new ItemStack(BoogatiteSword, 1), new Object[]{ "* ", "* ", "| ", Character.valueOf('*'), mod_Boogatite.Boogatite.itemID, Character.valueOf('|'), Item.stick.itemID }); ModLoader.addRecipe(new ItemStack(BoogatiteSword, 1), new Object[]{ " *", " *", " | ", Character.valueOf('*'), mod_Boogatite.Boogatite.itemID, Character.valueOf('|'), Item.stick.itemID }); ModLoader.addRecipe(new ItemStack(BoogatiteHoe, 1), new Object[]{ "** ", " | ", " | ", Character.valueOf('*'), mod_Boogatite.Boogatite.itemID, Character.valueOf('|'), Item.stick.itemID }); ModLoader.addRecipe(new ItemStack(BoogatitePickaxe, 1), new Object[]{ " **", " | ", " | ", Character.valueOf('*'), mod_Boogatite.Boogatite.itemID, Character.valueOf('|'), Item.stick.itemID }); ModLoader.addRecipe(new ItemStack(BoogatitePickaxe, 1), new Object[]{ "** ", "| ", "| ", Character.valueOf('*'), mod_Boogatite.Boogatite.itemID, Character.valueOf('|'), Item.stick.itemID }); ModLoader.addRecipe(new ItemStack(BoogatitePickaxe, 1), new Object[]{ " **", " |", " |", Character.valueOf('*'), mod_Boogatite.Boogatite.itemID, Character.valueOf('|'), Item.stick.itemID }); } public void generateSurface(World world, Random random, int chunkX, int chunkZ){ Random randomGenerator = random; for (int i = 0; i < 13; i++){ int randPosX = chunkX + randomGenerator.nextInt(8); int randPosY = random.nextInt(40); int randPosZ = chunkZ + randomGenerator.nextInt(8); (new WorldGenMinable(BoogatiteOre.blockID, 8)).generate(world, random, randPosX, randPosY, randPosZ); } } public String getVersion(){ return "1.5.1"; } }BlockBoogatiteOre
package net.minecraft.src; import java.util.Random; public class BlockBoogatiteOre extends Block{ public BlockBoogatiteOre(int par1, int i){ super(par1, Material.rock); this.setCreativeTab(CreativeTabs.tabBlock); } public int idDropped(int i, Random random, int j){ return mod_Boogatite.Boogatite.itemID; } public int quantityDropped(Random random){ return 1; } }BlockBoogatiteBlock
package net.minecraft.src; import java.util.Random; public class BlockBoogatiteBlock extends Block{ public BlockBoogatiteBlock(int par1, int i){ super(par1, Material.iron); this.setCreativeTab(CreativeTabs.tabBlock); } public int idDropped(int i, Random random, int j){ return mod_Boogatite.BoogatiteBlock.blockID; } public int quantityDropped(Random random){ return 1; } }ItemBoogatite
package net.minecraft.src; import java.util.Random; public class ItemBoogatite extends Item{ public ItemBoogatite(int i){ super(i); maxStackSize = 64; } public String Version(){ return "1.5.1"; } }P.S. I haven't put in textures in yet, but another mod I made didn't have textures when I ran it in Minecraft, and it worked fine
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumIn the ModLoader.addArmor take of the "_" at the end and if that does not work send me the entire modding folder for me to download.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumDude your a life savior, why would I ignore nether ore generation. Your awesome, if someone asked me to put up a code a will of it works and your worked very well. Thanks.
Here is my code:
my mod_test class
package net.minecraft.src;
import java.util.Random;
public class mod_test extends BaseMod
{
public static final Block Rubyore = new Block(160,Material.ground).getIndirectPowerOutput("rubyore").setCreativeTab(CreativeTabs.tabBlock).setHardness(5F).setResistance(6F).setLightValue(0.375F).setStepSound(Block.soundStoneFootstep);
public static final Item ruby = new Item(4000).setCreativeTab(CreativeTabs.tabMaterials).setUnlocalizedName("ruby");
public String getVersion()
{
return "test";
}
public void load()
{
ModLoader.registerBlock(Rubyore);//registers the block
ModLoader.addName(Rubyore, "Ruby Ore");
ModLoader.addName(ruby, "Ruby");//sets the name of the item
}
public void generateSurface(World world, Random random, int i, int j)
{
for(int k = 0; k < 5; k++)
{
int randPosX = i + random.nextInt(16);
int randPosY = random.nextInt(30);
int randPosZ = j + random.nextInt(16);
(new WorldGenMinable(Rubyore.blockID, 6)).generate(world, random, randPosX, randPosY, randPosZ);
}
}
}
My BlockRubyOre Class:
package net.minecraft.src;
import java.util.Random;
public class BlockRubyOre extends Block
{
public BlockRubyOre(int par1)
{
super(par1, Material.rock);
this.setCreativeTab(CreativeTabs.tabBlock);
}
public int idDropped(int i, Random par2Random, int j)
{
return mod_test.ruby.itemID;
}
}
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumIn the public static final block take off the material, you all ready have that in your blockNAME classMake sure that the item and block show up in game or creative tab.
It didn't work, so here's my mcp folder (Please tell me the changes):
https://www.dropbox.com/sh/x6fhh85ieq6s00x/g8ywbwq4Qk
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumI'm kind of busy but ill look thru the codes when I'm done
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumNow try the code!
And you need to create a new Class called ItemRuby.
Thanks! also how do i set it so it can be only broken by a certain pickaxe (like iron) and how fast it breaks?
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumI'll try to give you a code.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumThe armor does not go in textures, the folders go like this:
Eclipse/client/bin/armor/NAME_1.png and NAME_2.png
There are two png files
in the method ModLoader.addArmor("NAME");
there is no underscore and just copy the diamond armor from the jar file and put them in your armor folder and name them
NAME_1.png and NAME_2.png
i dont have the armor folder should i make it?
package net.minecraft.src;
import java.util.Random;
public class mod_test extends BaseMod
{
public static final Block Rubyore = new BlockRubyOre(160).getIndirectPowerOutput("rubyore").setCreativeTab(CreativeTabs.tabBlock).setHardness(5F).setResistance(6F).setLightValue(0.375F).setStepSound(Block.soundStoneFootstep);
public static final Item ruby = new ItemRuby(161).setCreativeTab(CreativeTabs.tabMaterials).setUnlocalizedName("ruby");
public static final Item RPick = new ItemPickaxe(2107, EnumToolMaterial.RUBY).setUnlocalizedName("rpick");
public static final Item RShovel = new ItemSpade(2108, EnumToolMaterial.RUBY).setUnlocalizedName("rshovel");
public static final Item RHoe= new ItemHoe(2109, EnumToolMaterial.RUBY).setUnlocalizedName("rhoe");
public static final Item RSword = new ItemSword(2110, EnumToolMaterial.RUBY).setUnlocalizedName("rsword");
public static final Item RAxe = new ItemAxe(2111, EnumToolMaterial.RUBY).setUnlocalizedName("raxe");
public static final Item RubyBody = (new ItemArmor(2200, EnumArmorMaterial.RUBY ,6,1 ).setUnlocalizedName("rubybody"));
public static final Item RubyHelmet = (new ItemArmor(2201,EnumArmorMaterial.RUBY ,6,0 ).setUnlocalizedName("rubyhelm"));
public static final Item RubyPants = (new ItemArmor(2202,EnumArmorMaterial.RUBY ,6,2 ).setUnlocalizedName("rubypants"));
public static final Item RubyBoots = (new ItemArmor(2203,EnumArmorMaterial.RUBY, 6, 3 ).setUnlocalizedName("rubyboots"));
public String getVersion()
{
return "test";
}
public void load()
{
//Ruby Chestplate
ModLoader.addName(RubyBody, "Ruby Chestplate");
ModLoader.addRecipe(new ItemStack(RubyBody,1), new Object[]{ "* *", "***", "***", Character.valueOf('*'), mod_test.ruby});
//Ruby Helmet
ModLoader.addName(RubyHelmet, "Ruby Helmet");
ModLoader.addRecipe(new ItemStack(RubyHelmet,1), new Object[]{ "***", "* *", Character.valueOf('*'), mod_test.ruby});
//Ruby Pants
ModLoader.addName(RubyPants, "Ruby Leggings");
ModLoader.addRecipe(new ItemStack(RubyPants,1), new Object[]{ "***", "* *", "* *", Character.valueOf('*'), mod_test.ruby});
//Ruby Boots
ModLoader.addName(RubyBoots, "Ruby Boots");
ModLoader.addRecipe(new ItemStack(RubyBoots,1), new Object[]{ "* *", "* *", Character.valueOf('*'), mod_test.ruby});
ModLoader.addArmor("ruby");
//Ruby Pickaxe
ModLoader.addName(RPick, "Ruby Pickaxe");
ModLoader.addRecipe(new ItemStack(RPick, 1), new Object[]{"***", " X ", " X ",('X'), Item.stick, ('*'), mod_test.ruby});
//Ruby Shovel
ModLoader.addName(RShovel, "Ruby Shovel");
ModLoader.addRecipe(new ItemStack(RShovel, 1), new Object[]{" * ", " X ", " X ",('X'), Item.stick, ('*'), mod_test.ruby});
//Ruby Hoe
ModLoader.addName(RHoe, "Ruby Hoe");
ModLoader.addRecipe(new ItemStack(RHoe, 1), new Object[]{"** ", " X ", " X ",('X'), Item.stick, ('*'), mod_test.ruby});
//Ruby Sword
ModLoader.addName(RSword, "Ruby Sword");
ModLoader.addRecipe(new ItemStack(RSword, 1), new Object[]{" * ", " * ", " X ", ('X'), Item.stick, ('*'), mod_test.ruby});
//Ruby Axe
ModLoader.addName(RAxe, "Ruby Axe");
ModLoader.addRecipe(new ItemStack(RAxe, 1), new Object[]{ "** ", "*X ", " X ", ('X'), Item.stick, ('*'), mod_test.ruby});
//Ruby Ore
ModLoader.registerBlock(Rubyore);
ModLoader.addName(Rubyore, "Ruby Ore");
//Ruby
ModLoader.addName(ruby, "Ruby");
}
public void generateSurface(World world, Random random, int i, int j)
{
for(int k = 0; k < 5; k++)
{
int randPosX = i + random.nextInt(16);
int randPosY = random.nextInt(30);
int randPosZ = j + random.nextInt(16);
(new WorldGenMinable(Rubyore.blockID, 6)).generate(world, random, randPosX, randPosY, randPosZ);
}
}
}