Skip to content

Instantly share code, notes, and snippets.

Created July 25, 2016 03:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/052c52c18b22a31cf406a60d7897fa72 to your computer and use it in GitHub Desktop.
Save anonymous/052c52c18b22a31cf406a60d7897fa72 to your computer and use it in GitHub Desktop.
package com.bigsis.spookjams.items; //My comments in this class are present in light-colored lines like this one that follow two forward-slashes ("//"). To remove these, go to "Edit > Find/Replace...", add "//.*" to the Find field, and press "Replace All".
import com.bigsis.spookjams.Reference; //Import this to recognize our custom Reference.java class.
import net.minecraft.creativetab.CreativeTabs; //Import this to recognize Minecraft Creative Tabs.
import net.minecraft.item.ItemFood; //Need this to recognize Minecraft Food Item objects.
public class ItemCheese extends ItemFood //Give this item food attributes.
{
public ItemCheese() //This is the constructor for your new Cheese Item.
{
super(6, 0.7F, false); //Specify how many half-hearts are provided after eating the cheese, how long its saturation duration should be (because fat is highly satiating!), and whether you can feed this to wolves (NO! dairy isn't good for canines). ;)
setUnlocalizedName(Reference.SpookjamItems.CHEESE.getUnlocalizedName()); //Set the common name of this new item from the CHEESE enum we declared in Reference.java.
setRegistryName(Reference.SpookjamItems.CHEESE.getRegistryName()); //Set the system name of this new item from the CHEESE enum we declared in Reference.java.
//The below is obsolete if we're already defining this as a food item, or if you're not planning to display this anywhere other than the Foodstuffs Creative Tab.
//this.setCreativeTab(CreativeTabs.FOOD); //Specify that this item appear in the Foodstuffs category of the standard Creative Menu.
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment