This is what i have untested please proofread for me i know there are coders that can spot any errors and real coders just speak code so please answer if thats you.
//This declares our new item, called itemCereal which is an item of type "ItemCereal".
public static final Item itemCereal = new ItemCereal(2000).setItemName("asdf");
public mod_Food()
{
//This overrides the texture pack and adds our own custom texture to the item.
itemCereal.iconIndex = ModLoader.addOverride("/gui/items.png", "/itemCereal.png");
//This adds the in game name
ModLoader.AddName(itemCereal, "Item Cereal");
//This adds the crafting recipe so that we can craft this item.
ModLoader.AddRecipe(new ItemStack(itemCereal, 15), new Object[]{
"#Y#", "#X#", "#Z#", Character.valueOf('X'), Item.milk, Character.valueOf('Y'), Item.Wheat, Character.valueOf('Z'), Item.bowlEmpty
});
}
public String Version()
{
return "3.14159265";
}
}
//THIS CODE GOES INTO YOUR ItemCereal.java FILE! (or whatever you named your item class)
//This declares an integer called "healAmount", which will specify how much health the food will heal
private int healAmount;
public ItemCereal(int i)
{
super(i);
//Here we set the heal amount to a number. Just remember, one heart = 2, two hearts = 4…etc.
//Also, put a negative number here if you want to make a poison
healAmount = 20;
//This is the maximum stack size, which is the maximum number of items you can have in one stack
maxStackSize = 15;
}
//This function tells Minecraft how much the food will heal.
public int getHealAmount()
{
return healAmount;
}
//This function tells Minecraft what to do when you right click while holding this item.
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer)
{
//This reduces the stack size by one each time you eat an item
//You can delete this line if you want to have a reusable healing item.
itemstack.stackSize--;
//This tells the player to heal by the heal amount.
entityplayer.heal(healAmount);
return itemstack;
}
}
Rollback Post to RevisionRollBack
If my avatar is the best you've seen hit up my reputation.
thanks.
package net.minecraft.src;
import java.util.Random;
public class mod_Food extends BaseMod
{
//This declares our new item, called itemCereal which is an item of type "ItemCereal".
public static final Item itemCereal = new ItemCereal(2000).setItemName("asdf");
public mod_Food()
{
//This overrides the texture pack and adds our own custom texture to the item.
itemCereal.iconIndex = ModLoader.addOverride("/gui/items.png", "/itemCereal.png");
//This adds the in game name
ModLoader.AddName(itemCereal, "Item Cereal");
//This adds the crafting recipe so that we can craft this item.
ModLoader.AddRecipe(new ItemStack(itemCereal, 15), new Object[]{
"#Y#", "#X#", "#Z#", Character.valueOf('X'), Item.milk, Character.valueOf('Y'), Item.Wheat, Character.valueOf('Z'), Item.bowlEmpty
});
}
public String Version()
{
return "3.14159265";
}
}
//THIS CODE GOES INTO YOUR ItemCereal.java FILE! (or whatever you named your item class)
package net.minecraft.src;
import java.util.Random;
public class ItemCereal extends Item
{
//This declares an integer called "healAmount", which will specify how much health the food will heal
private int healAmount;
public ItemCereal(int i)
{
super(i);
//Here we set the heal amount to a number. Just remember, one heart = 2, two hearts = 4…etc.
//Also, put a negative number here if you want to make a poison
healAmount = 20;
//This is the maximum stack size, which is the maximum number of items you can have in one stack
maxStackSize = 15;
}
//This function tells Minecraft how much the food will heal.
public int getHealAmount()
{
return healAmount;
}
//This function tells Minecraft what to do when you right click while holding this item.
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer)
{
//This reduces the stack size by one each time you eat an item
//You can delete this line if you want to have a reusable healing item.
itemstack.stackSize--;
//This tells the player to heal by the heal amount.
entityplayer.heal(healAmount);
return itemstack;
}
}
thanks.
You didn't say what the # is equal to.
#=nothing should i just use empty space i dont want a shapeless recipe
thanks.
Oh :blink.gif: I didn't know that.