| Tutorials Navigation |
|---|
|
|
| [ Minecraft ] How To Make Your Own Food! [ Any Version ] |
|---|
|
Tutorial Name: [ Minecraft ] How To Make Your Own Food! [ Any Version ] Category: PC Tutorials Submitted By: Console Date Added: Mon. May 21, 2012 Views: 2,107 Share:
How to make a new Food:
In this tutorial i will teach you how to make your own food! Ok first of all create a new file called mod_Whatever... im calling mine mod_Chocolate for this tutorial! So first off enter this code into your mod_Chocolate file: package net.minecraft.src;
public class mod_Chocolate extends BaseMod { public static final Item Chocolate = new ItemFood(ID, HEALAMOUNT, false).setItemName("Chocolate"); public mod_Chocolate() { //crafting codes, etc } public String Version() { return "yourversion"; } } So this is pretty easy to understand.... Basically edit the names... and then where it says ID, change that to the item id you want your food to be - 40,000 i think is the max and then the heal amount.... Basically 10 is half of full hearts.... so here is the list:
Then you add overrides etc... So here is my full mod_Chocolate and check how i did it: package net.minecraft.src; public class mod_Chocolate extends BaseMod { public static final Item Chocolate = new ItemFood(2200, 6, false).setItemName("Chocolate"); public mod_Chocolate() { Chocolate.iconIndex = ModLoader.addOverride("/gui/items.png", "chocolate.png"); ModLoader.AddName(Chocolate, "Chocolate"); ModLoader.AddRecipe(new ItemStack(Chocolate, 64), new Object[] { "XXX", "XXX", "XXX", Character.valueOf('X'), Item.cocoaBeans, Character.valueOf('A')}); } public String Version() { return "yourversion"; } } Then you need to create an ItemChocolate file: package net.minecraft.src;
public class ItemChocolate extends ItemFood { public ItemChocolate(int i, int j) { super(i, j, true); maxStackSize = (1); } } Basically all you need to do is rename and all you need to know is that, int i will call the id, int j will call the heal amount. And there! You have your own food item! Thanks Guys! |
| Ratings | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Current rating: 5.25 by 12 users
|
|||||||||||||
| Comments | ||
|---|---|---|
|
||

[code]public String getVersion() {
// TODO Auto-generated method stub
return null;
}
public void load(){
// TODO Auto-generated method stub
}[/code]
is required