Don't worry, I just started modding 4 or 5 days ago, you'll get used to it You'll have to create yourself the ItemIngot class, since it's a new Item. An ingot is just an item for crafting tools, so all you have to do is edit the template I'll post with the name of your ingot on the places where it says TestIngot ^^
package net.minecraft.src;
public class TestIngot extends Item
{
public TestIngot(int i)
{
super(i);
maxStackSize = 64;
}
}
Try asking in Mod Development. I can't think of anything else that may be causing it.
Alright, I did. I realized that after looking at my code I forgot to register the blocks for the dirt and ground...stupid me. However, I would like to thank you for all your help
, On the 5th line, write "public static final Block testblock" and not "public static final Block TestBlock" capitals are important too, if it still doesn't work I'll try something different ^^
Also, there is still a second X in the crafting recipe that might be screwing it up (he might be crafting it wrong so to speak)
, On the 5th line, write "public static final Block testblock" and not "public static final Block TestBlock" capitals are important too, if it still doesn't work I'll try something different ^^
Well, I tried this and.. nothing. So I tried to rewrite the code, and... nothing. The same problem, I can't craft the item, and probably the item doesn't even exist.
The mod_test class:
package net.minecraft.src;
public class mod_test extends BaseMod
{
public static final Block testblock = new testblock(225, 0).setBlockName("Test Block").setHardness(3F).setResistance(20F).setLightValue(20F);
public void load()
{
testblock.blockIndexInTexture = ModLoader.addOverride("terrain.png", "/russo/testblock.png");
ModLoader.registerBlock(testblock);
ModLoader.addName(testblock, "Test Block");
ModLoader.addRecipe(new ItemStack(testblock, 1), new Object [] {"#", Character.valueOf('#'), Block.dirt});
}
public String getVersion()
{
return "1.2.5"
}
}
Well, I tried this and.. nothing. So I tried to rewrite the code, and... nothing. The same problem, I can't craft the item, and probably the item doesn't even exist.
The mod_test class:
package net.minecraft.src;
public class mod_test extends BaseMod
{
public static final Block testblock = new testblock(225, 0).setBlockName("Test Block").setHardness(3F).setResistance(20F).setLightValue(20F);
public void load()
{
testblock.blockIndexInTexture = ModLoader.addOverride("terrain.png", "/russo/testblock.png");
ModLoader.registerBlock(testblock);
ModLoader.addName(testblock, "Test Block");
ModLoader.addRecipe(new ItemStack(testblock, 1), new Object [] {"#", Character.valueOf('#'), Block.dirt});
}
public String getVersion()
{
return "1.2.5"
}
}
did you make the second class for the block?
package net.minecraft.src;
import java.util.Random;
public class BlockTestBlock extends Block
{
public BlockTestBlock(int i, int j)
{
super(i, j, Material.wood);
}
public int idDropped(int i, Random random, int j)
{
return mod_TestBlock.TestBlock.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}}
''class BlockTestBlock is public, should be declared in a file named BlockTestBlock.java public class BlockTestBlock extends Block''
What does it mean ?
And one more doubt: How should I save the modloader basic file and the block file ? ''mod_test.class, BlockTestblock.class" or ''mod_test.java, BlockTestblock.java" ?
''class BlockTestBlock is public, should be declared in a file named BlockTestBlock.java public class BlockTestBlock extends Block''
What does it mean ?
And one more doubt: How should I save the modloader basic file and the block file ? ''mod_test.class, BlockTestblock.class" or ''mod_test.java, BlockTestblock.java" ?
2. run the cleanup.bat file (yes this will remove all code)
3. Make sure you install modloader into Minecraft.jar in mcp's jars folder (delete META-INF!)
4. run decompile.bat
5. set up eclipse according to techguy's tutorial
6. Code!
Eclipse will help you a lot with the coding as it will help you create the classes and all you really have to worry about is the code inside being right
This link is for JDK 7, but the best one is the JDK 6, isn't it ?
JDK 7 is most recent, I'm not sure which is "better" but get JDK 7, thats what I'm using.
Edit: Also, you should be sure to get the 64 bit version of eclipse, i think you got the 32 bit version and from your post it looks like your machine is x64
I got a problem (again). I wanted to generate a block the same way as pumpkins does, so I used the WorldGenPumpkin class file and I changed the pumpkin for the block I wanted to use. I remembered that it worked in 1.8.1 when I modded minecraft without modloader and I thought that it would work again. I get no errors when I recompile, but the block is nowhere to be seen!
Here's the code:
package net.minecraft.src;
import java.util.Random;
public class WorldGenStarBlock extends WorldGenerator
{
public WorldGenStarBlock()
{
}
public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5)
{
for (int i = 0; i < 64; i++)
{
int j = (par3 + par2Random.nextInt(8)) - par2Random.nextInt(8);
int k = (par4 + par2Random.nextInt(4)) - par2Random.nextInt(4);
int l = (par5 + par2Random.nextInt(8)) - par2Random.nextInt(8);
if (par1World.isAirBlock(j, k, l) && par1World.getBlockId(j, k - 1, l) == Block.grass.blockID && mod_DatMod.StarBlock.canPlaceBlockAt(par1World, j, k, l))
{
par1World.setBlockAndMetadata(j, k, l, mod_DatMod.StarBlock.blockID, par2Random.nextInt(4));
}
}
return true;
}
}
package net.minecraft.src;
import java.util.Random;
public class BlockTestBlock extends Block
{
public BlockTestBlock(int i, int j)
{
super(i, j, Material.rock);
}
public int idDropped(int i, Random random, int j)
{
return mod_Block.TestBlock.blockID;
}
public int quantityDropped(Random random)
{
return 3;
}}
package net.minecraft.src;
import java.util.Random;
public class BlockTestBlock extends Block
{
public BlockTestBlock(int i, int j)
{
super(i, j, Material.rock);
}
public int idDropped(int i, Random random, int j)
{
return mod_Block.TestBlock.blockID;
}
public int quantityDropped(Random random)
{
return 3;
}}
How so?
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
What should I do about that ?
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumThank you
Alright, I did. I realized that after looking at my code I forgot to register the blocks for the dirt and ground...stupid me. However, I would like to thank you for all your help
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumAlso, there is still a second X in the crafting recipe that might be screwing it up (he might be crafting it wrong so to speak)
Well, I tried this and.. nothing. So I tried to rewrite the code, and... nothing. The same problem, I can't craft the item, and probably the item doesn't even exist.
The mod_test class:
package net.minecraft.src; public class mod_test extends BaseMod { public static final Block testblock = new testblock(225, 0).setBlockName("Test Block").setHardness(3F).setResistance(20F).setLightValue(20F); public void load() { testblock.blockIndexInTexture = ModLoader.addOverride("terrain.png", "/russo/testblock.png"); ModLoader.registerBlock(testblock); ModLoader.addName(testblock, "Test Block"); ModLoader.addRecipe(new ItemStack(testblock, 1), new Object [] {"#", Character.valueOf('#'), Block.dirt}); } public String getVersion() { return "1.2.5" } }-
View User Profile
-
View Posts
-
Send Message
Curse Premiumdid you make the second class for the block?
package net.minecraft.src; import java.util.Random; public class BlockTestBlock extends Block { public BlockTestBlock(int i, int j) { super(i, j, Material.wood); } public int idDropped(int i, Random random, int j) { return mod_TestBlock.TestBlock.blockID; } public int quantityDropped(Random random) { return 1; }}EDIT:
package net.minecraft.src; public class mod_test extends BaseMod { public static final Block testblock = new testblock(225, 0).setBlockName("Test Block").setHardness(3F).setResistance(20F).setLightValue(20F); public void load() { testblock.blockIndexInTexture = ModLoader.addOverride("terrain.png", "/russo/emeraldOre.png"); ModLoader.registerBlock(testblock); ModLoader.addName(testblock, "Test Block"); ModLoader.addRecipe(new ItemStack(testblock, 1), new Object [] {"#", Character.valueOf('#'), Block.dirt}); } public String getVersion() { return "1.2.5"; } }And in this code, can you explain me how can I decide how many items/blocks will drop ? Like I want my block to drop 3 dirts. Can I do it ?
-
View User Profile
-
View Posts
-
Send Message
Curse Premiumalso, could you repost the code, the colors messed it up and no one can read it
I see now you have already done that lol
-
View User Profile
-
View Posts
-
Send Message
Curse Premiumthats still the "mod_" class what about the "BlockNameHere" class?
When I try to recompile I get this error:
''class BlockTestBlock is public, should be declared in a file named BlockTestBlock.java public class BlockTestBlock extends Block''
What does it mean ?
And one more doubt: How should I save the modloader basic file and the block file ? ''mod_test.class, BlockTestblock.class" or ''mod_test.java, BlockTestblock.java" ?
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumThey should be saved as .java files
What should I do ?
-
View User Profile
-
View Posts
-
Send Message
Curse Premium2. run the cleanup.bat file (yes this will remove all code)
3. Make sure you install modloader into Minecraft.jar in mcp's jars folder (delete META-INF!)
4. run decompile.bat
5. set up eclipse according to techguy's tutorial
6. Code!
Eclipse will help you a lot with the coding as it will help you create the classes and all you really have to worry about is the code inside being right
''Failed to load the JNI shared library ''C:\Program Files(x86)\Java\jdk(1.6.0)\bin\...\jre\bin\client\jvm.dll"
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumThen you sir do not have JDK installed, you can grab it from here though: http://www.oracle.com/technetwork/java/javase/downloads/jdk-7u3-download-1501626.html
Then retry eclipse.
This link is for JDK 7, but the best one is the JDK 6, isn't it ?
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumJDK 7 is most recent, I'm not sure which is "better" but get JDK 7, thats what I'm using.
Edit: Also, you should be sure to get the 64 bit version of eclipse, i think you got the 32 bit version and from your post it looks like your machine is x64
Here's the code:
package net.minecraft.src; import java.util.Random; public class WorldGenStarBlock extends WorldGenerator { public WorldGenStarBlock() { } public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) { for (int i = 0; i < 64; i++) { int j = (par3 + par2Random.nextInt(8)) - par2Random.nextInt(8); int k = (par4 + par2Random.nextInt(4)) - par2Random.nextInt(4); int l = (par5 + par2Random.nextInt(8)) - par2Random.nextInt(8); if (par1World.isAirBlock(j, k, l) && par1World.getBlockId(j, k - 1, l) == Block.grass.blockID && mod_DatMod.StarBlock.canPlaceBlockAt(par1World, j, k, l)) { par1World.setBlockAndMetadata(j, k, l, mod_DatMod.StarBlock.blockID, par2Random.nextInt(4)); } } return true; } }But I am having problems with this block code:
package net.minecraft.src; import java.util.Random; public class BlockTestBlock extends Block { public BlockTestBlock(int i, int j) { super(i, j, Material.rock); } public int idDropped(int i, Random random, int j) { return mod_Block.TestBlock.blockID; } public int quantityDropped(Random random) { return 3; }}-
View User Profile
-
View Posts
-
Send Message
Curse PremiumHow so?