I think installing it would just be putting it in the mods folder because you do not edit base classes
tech guy I know you said you were going to start working on a tree tutorial but do you know any you can recommend so that I can start work on my biome I am hoping to make with custom trees.
Just look at the source code of Minecraft.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
ModLoader.addSmelting(Item.egg.shiftedIndex, new ItemStack(ItemEggcooked, 1), 1.0F);
This looks like it should work to me...
Oh yeah, does the Java file that I made for this recipe have to be
named a specific way, like how some stuff needs to be ItemEgg and mod_egg
and stuff?
ModLoader.addSmelting(Item.egg.shiftedIndex, new ItemStack(ItemEggcooked, 1), 1.0F);
This looks like it should work to me...
Oh yeah, does the Java file that I made for this recipe have to be
named a specific way, like how some stuff needs to be ItemEgg and mod_egg
and stuff?
that chunk of code should be in the mod_egg file, somewhere in the "public void load(){" method.
that chunk of code should be in the mod_egg file, somewhere in the "public void load(){" method.
Thanks, took some doing but I figured out where to put it, and I now finally have a completely
working cookable fryed in in Minecraft!Thank you very much, kind sir. +1 for you
I had tryed putting it there before, but I guess it must be, for some reason, specificaly
ABOVE the crafting recipe, because code is a jerk.
ModLoader.addSmelting(Item.egg.shiftedIndex, new ItemStack(ItemEggcooked, 1), 1.0F);
This looks like it should work to me...
Oh yeah, does the Java file that I made for this recipe have to be
named a specific way, like how some stuff needs to be ItemEgg and mod_egg
and stuff?
The ItemEggcooked isn't what's supposed to be after the new ItemStack statement, it's the name of the item that you defined in your mod_ file.
Rollback Post to RevisionRollBack
When life gives you a potato, wonder why the heck life just gave you a potato. Why not something else? Like money? Or a combustable lemon? No, you get a potato. Nothing else.
Gah! Now that I tryed actualy installing it into a new Minecraft.jar with modloader, it keeps crashing!
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem; Unexpected error
This error has been saved to C:\Users\Christian\AppData\Roaming\.minecraft\crash-reports\crash-2012-09-19_18.36.25-client.txt for your convenience. Please include a copy of this file if you report this crash to anyone.
--- BEGIN ERROR REPORT 202d335a --------
Generated 9/19/12 6:36 PM
- Minecraft Version: 1.3.2
- Operating System: Windows 7 (amd64) version 6.1
- Java Version: 1.7.0_01, Oracle Corporation
- Java VM Version: Java HotSpot™ 64-Bit Server VM (mixed mode), Oracle Corporation
- Memory: 391703816 bytes (373 MB) / 514523136 bytes (490 MB) up to 954466304 bytes (910 MB)
- JVM Flags: 2 total; -Xms512m -Xmx1024m
- ModLoader: Mods loaded: 2
ModLoader 1.3.2
mod_Eggcooked 1.3.2
- LWJGL: 2.4.2
- OpenGL: AMD Radeon HD 6530D Graphics GL version 4.1.10834 Compatibility Profile Context, ATI Technologies Inc.
- Is Modded: Very likely
- Type: Client
- Texture Pack: Default
- Profiler Position: N/A (disabled)
java.lang.RuntimeException: java.lang.Exception: Image not found: /fryedegg.png
at ModLoader.registerAllTextureOverrides(ModLoader.java:1612)
at ModLoader.onTick(ModLoader.java:1186)
at EntityRendererProxy.b(EntityRendererProxy.java:21)
at net.minecraft.client.Minecraft.J(SourceFile:607)
at net.minecraft.client.Minecraft.run(SourceFile:535)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.Exception: Image not found: /fryedegg.png
at ModLoader.loadImage(ModLoader.java:1106)
at ModLoader.registerAllTextureOverrides(ModLoader.java:1604)
... 5 more
--- END ERROR REPORT 42451bd0 ----------
Apparently, it has something to do with it not being able to find the texture
for the egg. And yet I put it in the gui folder, and I had this code...
package net.minecraft.src;
public class mod_Eggcooked extends BaseMod
{
public static final Item ItemEggcooked = new ItemFood(5001, 6, 1F, false).setItemName("fryedegg");
public void load()
{
ItemEggcooked.iconIndex = ModLoader.addOverride("/gui/items.png", "/fryedegg.png");
ModLoader.addName(ItemEggcooked, "fryed egg");
ModLoader.addSmelting(Item.egg.shiftedIndex, new ItemStack(ItemEggcooked, 1), 1.0F);
ModLoader.addRecipe(new ItemStack(ItemEggcooked, 1), new Object [] {"#", '#',
Block.dirt });
}
public String getVersion()
{
return "1.3.2";
}
}
Gah! Now that I tryed actualy installing it into a new Minecraft.jar with modloader, it keeps crashing!
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem; Unexpected error
This error has been saved to C:\Users\Christian\AppData\Roaming\.minecraft\crash-reports\crash-2012-09-19_18.36.25-client.txt for your convenience. Please include a copy of this file if you report this crash to anyone.
--- BEGIN ERROR REPORT 202d335a --------
Generated 9/19/12 6:36 PM
- Minecraft Version: 1.3.2
- Operating System: Windows 7 (amd64) version 6.1
- Java Version: 1.7.0_01, Oracle Corporation
- Java VM Version: Java HotSpot™ 64-Bit Server VM (mixed mode), Oracle Corporation
- Memory: 391703816 bytes (373 MB) / 514523136 bytes (490 MB) up to 954466304 bytes (910 MB)
- JVM Flags: 2 total; -Xms512m -Xmx1024m
- ModLoader: Mods loaded: 2
ModLoader 1.3.2
mod_Eggcooked 1.3.2
- LWJGL: 2.4.2
- OpenGL: AMD Radeon HD 6530D Graphics GL version 4.1.10834 Compatibility Profile Context, ATI Technologies Inc.
- Is Modded: Very likely
- Type: Client
- Texture Pack: Default
- Profiler Position: N/A (disabled)
java.lang.RuntimeException: java.lang.Exception: Image not found: /fryedegg.png
at ModLoader.registerAllTextureOverrides(ModLoader.java:1612)
at ModLoader.onTick(ModLoader.java:1186)
at EntityRendererProxy.b(EntityRendererProxy.java:21)
at net.minecraft.client.Minecraft.J(SourceFile:607)
at net.minecraft.client.Minecraft.run(SourceFile:535)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.Exception: Image not found: /fryedegg.png
at ModLoader.loadImage(ModLoader.java:1106)
at ModLoader.registerAllTextureOverrides(ModLoader.java:1604)
... 5 more
--- END ERROR REPORT 42451bd0 ----------
Apparently, it has something to do with it not being able to find the texture
for the egg. And yet I put it in the gui folder, and I had this code...
package net.minecraft.src;
public class mod_Eggcooked extends BaseMod
{
public static final Item ItemEggcooked = new ItemFood(5001, 6, 1F, false).setItemName("fryedegg");
public void load()
{
ItemEggcooked.iconIndex = ModLoader.addOverride("/gui/items.png", "/fryedegg.png");
ModLoader.addName(ItemEggcooked, "fryed egg");
ModLoader.addSmelting(Item.egg.shiftedIndex, new ItemStack(ItemEggcooked, 1), 1.0F);
ModLoader.addRecipe(new ItemStack(ItemEggcooked, 1), new Object [] {"#", '#',
Block.dirt });
}
public String getVersion()
{
return "1.3.2";
}
}
What's wrong with it NOW?!
its the textures if you put the friedegg.png inside a folder you need to add this "/(name of folder)/friedegg.png"
I am not getting errors when Recompiling but for some reason it will not even add my block anymore. I probably made an extremely stupid error but if you could point it out for me that would be great. here is my code:
(mod_thing.java)
package net.minecraft.src;
public class mod_thing extends BaseMod
{
public static final Block Mud = new BlockMud(160, 0).setBlockName("Mud").setHardness(2F).setResistance(2F).setCreativeTab(CreativeTabs.tabBlock).setStepSound(Block.soundGrassFootstep);
public static final Item MudBrick = new ItemMudBrick(5000).setItemName("MudBrick").setTabToDisplayOn(CreativeTabs.tabMaterials);
public static final Block MudBrickB = new BlockMudBrickB(236, 0).setBlockName("Mud Brick").setHardness(4F).setResistance(4F).setCreativeTab(CreativeTabs.tabBlock).setStepSound(Block.soundStoneFootstep);
public void load()
{
Mud.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/textures/Mud.png");
ModLoader.registerBlock(Mud);
ModLoader.addName(Mud, "Mud");
ModLoader.addSmelting(Mud.blockID, new ItemStack(MudBrick, 1), 0.1F);
ModLoader.addRecipe(new ItemStack(Mud, 4), new Object [] {"#",Character.valueOf('#'), Block.dirt});
}
{
MudBrickB.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/textures/MudBrickBlock.png");
ModLoader.registerBlock(MudBrickB);
ModLoader.addName(MudBrickB, "Mud Brick");
ModLoader.addRecipe(new ItemStack(MudBrickB, 1), new Object [] {"##", "##", Character.valueOf('#'), MudBrick.shiftedIndex});
}
{
MudBrick.iconIndex = ModLoader.addOverride("/gui/items.png", "/textures/Mudbrick.png");
ModLoader.addName(MudBrick, "Mud Brick");
}
public String getVersion()
{
return "1.3.2";
}
}
(BlockMud.java)
package net.minecraft.src;
import java.util.Random;
public class BlockMud extends Block
{
public BlockMud(int i, int j)
{
super(i, j, Material.wood);
}
public int idDropped(int i, Random random, int j)
{
return mod_thing.Mud.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}
}
(BlockMudBrickB.java)
package net.minecraft.src;
import java.util.Random;
public class BlockMudBrickB extends Block
{
public BlockMudBrickB(int i, int j)
{
super(i, j, Material.rock);
}
public int idDropped(int i, Random random, int j)
{
return mod_thing.MudBrickB.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}
}
(ItemMudBrick.java)
package net.minecraft.src;
public class ItemMudBrick extends Item
{
public ItemMudBrick(int i)
{
super(i);
maxStackSize = 64;
}
}
Hello, I'm a fairly advanced modder, but I've come across a reoccuring problem which just doesn't want to be fixed. When I try to get a block to drop an extra item (such as how wheat crop can drop seeds), the items that drop are not able to be picked up. The entities appear, but don't actually seem to exits.
Here is an example of such code.
package net.minecraft.src;
import java.util.Random;
public class BlockStone extends Block
{
public BlockStone(int par1, int par2)
{
super(par1, par2, Material.rock);
this.setCreativeTab(CreativeTabs.tabBlock);
}
/**
* Returns the ID of the items to drop on destruction.
*/
public int idDropped(int par1, Random par2Random, int par3)
{
return Block.cobblestone.blockID;
}
//added by mediate
public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5)
{
super.onBlockDestroyedByPlayer(par1World, par2, par3, par4, par5);
if(rand.nextInt(4) == 0)
{
par1World.setBlockWithNotify(par2, par3, par4, 0);
EntityItem entityitem = new EntityItem(par1World, (float)par2, (float)par3, (float)par4, new ItemStack(mod_Mediate.wpnPebble));
entityitem.delayBeforeCanPickup = 10;
par1World.spawnEntityInWorld(entityitem);
}
}
public Random rand = new Random();
}
I cannot seem to find the .class file for the block 'Glass Pane' in the package net.minecraft.src. May I have the name for that file?
There is no BlockGlassPane file. It's just BlockPane; the GlassPane is a new instance of BlockPane, along with iron bars.
Rollback Post to RevisionRollBack
When life gives you a potato, wonder why the heck life just gave you a potato. Why not something else? Like money? Or a combustable lemon? No, you get a potato. Nothing else.
Once I find the source, can I help to continue these tutorials? I don't think I'd be able to answer questions and give feedback (I wouldn't have very much time), but I could make more tutorials on more things.
Anyone who says ModLoader sucks will wither, die and blow away.
I appreciate the tutorial! It is helping me lots! But I have one problem.
I get an error on the line below for the = new BlockNameHere and it says that it's not a file type. What do I do on this part? I don't understand on the BlockNameHere part. Do I add the Block name or do I leave it as is? I tried putting my block name and it still did the same thing.
On this line "publicstaticfinal Block nameHere =new BlockNameHere"
big question how would i make a block that can only be mined by a stone pickaxe or higher
You change the block hardness at the line
".setHardness(3F)" where the 3F is how much or how long it will take to mine it. A wood pickaxe wouldn't mine through a block with 2f or higher. I think it is 2F, but Diamond has a Hardness level of 3F which a stone or wooden would not be able to mine. so mess around with it, I would also try Harvest level also.
".setHardness(3F)" where the 3F is how much or how long it will take to mine it. A wood pickaxe wouldn't mine through a block with 2f or higher. I think it is 2F, but Diamond has a Hardness level of 3F which a stone or wooden would not be able to mine. so mess around with it, I would also try Harvest level also.
Hardness just has to do with the time it takes to mine the block; nothing to do with what type of pick can mine it.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Just look at the source code of Minecraft.
together they are powerful beyond imagination."
ok thanks
This looks like it should work to me...
Oh yeah, does the Java file that I made for this recipe have to be
named a specific way, like how some stuff needs to be ItemEgg and mod_egg
and stuff?
that chunk of code should be in the mod_egg file, somewhere in the "public void load(){" method.
Thanks, took some doing but I figured out where to put it, and I now finally have a completely
working cookable fryed in in Minecraft!Thank you very much, kind sir. +1 for you
I had tryed putting it there before, but I guess it must be, for some reason, specificaly
ABOVE the crafting recipe, because code is a jerk.
The ItemEggcooked isn't what's supposed to be after the new ItemStack statement, it's the name of the item that you defined in your mod_ file.
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem; Unexpected error
This error has been saved to C:\Users\Christian\AppData\Roaming\.minecraft\crash-reports\crash-2012-09-19_18.36.25-client.txt for your convenience. Please include a copy of this file if you report this crash to anyone.
--- BEGIN ERROR REPORT 202d335a --------
Generated 9/19/12 6:36 PM
- Minecraft Version: 1.3.2
- Operating System: Windows 7 (amd64) version 6.1
- Java Version: 1.7.0_01, Oracle Corporation
- Java VM Version: Java HotSpot™ 64-Bit Server VM (mixed mode), Oracle Corporation
- Memory: 391703816 bytes (373 MB) / 514523136 bytes (490 MB) up to 954466304 bytes (910 MB)
- JVM Flags: 2 total; -Xms512m -Xmx1024m
- ModLoader: Mods loaded: 2
ModLoader 1.3.2
mod_Eggcooked 1.3.2
- LWJGL: 2.4.2
- OpenGL: AMD Radeon HD 6530D Graphics GL version 4.1.10834 Compatibility Profile Context, ATI Technologies Inc.
- Is Modded: Very likely
- Type: Client
- Texture Pack: Default
- Profiler Position: N/A (disabled)
java.lang.RuntimeException: java.lang.Exception: Image not found: /fryedegg.png
at ModLoader.registerAllTextureOverrides(ModLoader.java:1612)
at ModLoader.onTick(ModLoader.java:1186)
at EntityRendererProxy.b(EntityRendererProxy.java:21)
at net.minecraft.client.Minecraft.J(SourceFile:607)
at net.minecraft.client.Minecraft.run(SourceFile:535)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.Exception: Image not found: /fryedegg.png
at ModLoader.loadImage(ModLoader.java:1106)
at ModLoader.registerAllTextureOverrides(ModLoader.java:1604)
... 5 more
--- END ERROR REPORT 42451bd0 ----------
Apparently, it has something to do with it not being able to find the texture
for the egg. And yet I put it in the gui folder, and I had this code...
What's wrong with it NOW?!
its the textures if you put the friedegg.png inside a folder you need to add this "/(name of folder)/friedegg.png"
(mod_thing.java)
package net.minecraft.src;
public class mod_thing extends BaseMod
{
public static final Block Mud = new BlockMud(160, 0).setBlockName("Mud").setHardness(2F).setResistance(2F).setCreativeTab(CreativeTabs.tabBlock).setStepSound(Block.soundGrassFootstep);
public static final Item MudBrick = new ItemMudBrick(5000).setItemName("MudBrick").setTabToDisplayOn(CreativeTabs.tabMaterials);
public static final Block MudBrickB = new BlockMudBrickB(236, 0).setBlockName("Mud Brick").setHardness(4F).setResistance(4F).setCreativeTab(CreativeTabs.tabBlock).setStepSound(Block.soundStoneFootstep);
public void load()
{
Mud.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/textures/Mud.png");
ModLoader.registerBlock(Mud);
ModLoader.addName(Mud, "Mud");
ModLoader.addSmelting(Mud.blockID, new ItemStack(MudBrick, 1), 0.1F);
ModLoader.addRecipe(new ItemStack(Mud, 4), new Object [] {"#",Character.valueOf('#'), Block.dirt});
}
{
MudBrickB.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/textures/MudBrickBlock.png");
ModLoader.registerBlock(MudBrickB);
ModLoader.addName(MudBrickB, "Mud Brick");
ModLoader.addRecipe(new ItemStack(MudBrickB, 1), new Object [] {"##", "##", Character.valueOf('#'), MudBrick.shiftedIndex});
}
{
MudBrick.iconIndex = ModLoader.addOverride("/gui/items.png", "/textures/Mudbrick.png");
ModLoader.addName(MudBrick, "Mud Brick");
}
public String getVersion()
{
return "1.3.2";
}
}
(BlockMud.java)
package net.minecraft.src;
import java.util.Random;
public class BlockMud extends Block
{
public BlockMud(int i, int j)
{
super(i, j, Material.wood);
}
public int idDropped(int i, Random random, int j)
{
return mod_thing.Mud.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}
}
(BlockMudBrickB.java)
package net.minecraft.src;
import java.util.Random;
public class BlockMudBrickB extends Block
{
public BlockMudBrickB(int i, int j)
{
super(i, j, Material.rock);
}
public int idDropped(int i, Random random, int j)
{
return mod_thing.MudBrickB.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}
}
(ItemMudBrick.java)
package net.minecraft.src;
public class ItemMudBrick extends Item
{
public ItemMudBrick(int i)
{
super(i);
maxStackSize = 64;
}
}
Please help, thanks :3
Here is an example of such code.
Minecraft technology - the logical way - the only way.
There is no BlockGlassPane file. It's just BlockPane; the GlassPane is a new instance of BlockPane, along with iron bars.
Thank you
Anyone who says ModLoader sucks will wither, die and blow away.
I get an error on the line below for the = new BlockNameHere and it says that it's not a file type. What do I do on this part? I don't understand on the BlockNameHere part. Do I add the Block name or do I leave it as is? I tried putting my block name and it still did the same thing.
On this line "publicstaticfinal Block nameHere =new BlockNameHere"
Thanks for the tutorial!
".setHardness(3F)" where the 3F is how much or how long it will take to mine it. A wood pickaxe wouldn't mine through a block with 2f or higher. I think it is 2F, but Diamond has a Hardness level of 3F which a stone or wooden would not be able to mine. so mess around with it, I would also try Harvest level also.
Hardness just has to do with the time it takes to mine the block; nothing to do with what type of pick can mine it.
together they are powerful beyond imagination."