|This Article is up to date with Custom Stuff 2|
Food is a type of item available in Minecraft. As the name would imply, food is eaten to replenish Hunger, which is in turn used to regenerate health. With Custom Stuff, you can input your favorite foods into Minecraft, giving you more variety in the sustenance available to you.
Adding new food to the game is mostly a matter of aesthetics, although you can create foods that are either easier or harder to obtain than the defaults making them effectively functional or interesting. Even if you just want to make foods that you like there are many, many item IDs available for use so adding a lot of fun items like food just to flesh out the feeling of your minecraft worlds to your own personal tastes (no pun intended) can hardly be considered wasteful.
In Custom Stuff 2, Food is an otherwise ordinary item that has properties such as alwaysEdible set to true. Typically the "hunger" and "saturation" attributes are also set to 1 or more, though this isn't necessary is you're using the food for a seperate function such as a potion effect. In these cases, the alwaysEdible attribute is set to true; something that is not the case for a normal food item like bread.
Food Example (CS2 0.10.2 and above)
config.addItemIdProperty("appleSauceID", 5011); mod.addAlias(260, "apple"); mod.addAlias(281, "bowl"); mod.addAlias(config.getItemId("appleSauceID"), "appleSauce"); mod.addItem("appleSauce.js", "food"); mod.addRecipe("appleSauce 1", 1, 2, "apple", "bowl");
id = config.getItemId("appleSauceID"); name = "appleSauce"; maxStack = 16; full3d = false; creativeTab = "food"; displayName = "Apple Sauce"; textureFile = "appleSauce.png"; addToCreative = true; alwaysEdible = false; hunger = 3; saturation = 2; onEaten = "player.add(281, 1, 0);"; //returns a bowl
Potion Example (CS2 0.10.2 and above)
config.addItemIdProperty("instantColaID"); mod.addItem("drink.js", "food");
id = config.getItemId("instaColaID"); name = "InstaCola"; displayName = "InstaCola"; textureFile = "instaCola.png"; maxStack = 10; full3d = false; addToCreative = true; creativeTab = "food"; alwaysEdible = true; potion = "regeneration"; potionDuration = 60; potionAmplifier = 255; potionProbability = 1.0; usingAction = "drink"; leaveContainerItem = true; containerItem = config.getItemId("emptyCanID") + " 1"; onEaten = "player.addPotionEffect('moveSpeed',1800,5);\ player.addPotionEffect('jump',1800,5);\ player.add(config.getItemId('emptyCanID'), 1, 0);";
Food Item Attributes
textureFile and textureIndex
In CS2 versions for 1.4.7 and below, CS2 0.9.9 or below, textureFile was used to specify the texture sheet and textureIndex was used for identifying the specific icon within the texture sheet. If using CS2 0.9.9 or lower, make sure to use both of these attributes.
Example Food Item
name="Pumpkin Cookie"; id=700; type="food"; iconfile="PSJust4Fun.png"; iconindex=0; maxstack=64; saturation=0.3; //How 'filling' the food item is. healamount=2; //How many units of food is healed. 1 = 1/2 'drumstick'.
Food Item Attributes
Below is a table of attributes available to food-type items, including information on notable attributes.
This must be set to 'food' for the item to be edible by the player.
This is an integer value. Each point heals half a 'drumstick' on the hunger bar. You can set this value as high as you like.
The saturation of the food represents how 'filling' the item is. Valid values for saturation are decimal numbers (0.1, 0.2, etc.) greater than zero. The higher the value the longer it takes to get hungry.
CS 1 Bugs
- In the current version (2.3.4) the particles that come from a food item when eaten are drawn from /gui/items.png regardless of which iconfile is chosen. The iconindex will determine which sprite is used, however. This may be a bug in Forge, and not a problem with Custom Stuff, as evidenced by how other Forge mods also seem to exhibit this problem.
- When in third person view, food items will seem to be very large because the game renders them with the same size and orientation of tools. This bug is still present in CS 2.3.4.