Tomcat
2011-11-14 19:49:17 UTC
The goal was to create a simple mod that made chocolate milk from having cocoa beans placed in a crafting square above a bucket of milk.
I created the code, compiled it, and it returns no errors. However, when I attempt to make said item in a crafting grid, nothing happens. No chocolate milk is made. I do not wish to use ModLoader for this mod due to the fact that I have tried 23 times to install ModLoader into Minecraft and crashed every time. Some help would be greatly appreciated.
I have two .java files in the src folder that I made: one is called ItemChocolateMilk.java and Start2.java. The code for both are posted below.
This is my code:
For ItemChocolateMilk.java:
package net.minecraft.src;
public class ItemChocolateMilk extends Item
{
public ItemChocolateMilk(int itemIndex)
{
super(itemIndex);
maxStackSize = 1;
setIconIndex(70);
setItemName("Chocolate Milk");
//Recipe is a bucket of milk below cocoa beans
CraftingManager.getInstance().addRecipe(new ItemStack(itemsList[shiftedIndex], 1), new Object[] {
"#", "X", Character.valueOf('#'), Item.bucketMilk, Character.valueOf('X'), new ItemStack(Item.dyePowder,3)
});
chocolatemilkID = shiftedIndex;
}
public static int chocolatemilkID;
}
For Start2.java:
import net.minecraft.src.ItemChocolateMilk;
public class Start2
{
public Start2()
{
}
public static void main(String args[])
{
net.minecraft.src.ItemChocolateMilk g = new net.minecraft.src.ItemChocolateMilk(390);
Start.main(args);
}
}