Skip to main content

Prepared Foods

Version History

Build VersionChange DateChange TypeDescription
6760422025-06-21stableCurrent version

Overview

The preparedfoods.lua module defines all standard recipes that can be crafted in regular cookpots throughout Don't Starve Together. This comprehensive system includes over 60 unique recipes ranging from basic sustenance to specialized dishes with unique effects, temperature modifications, and nutritional benefits.

Module Structure

The module exports a table of food definitions where each recipe includes test conditions, nutritional values, cooking parameters, and optional special effects:

local foods = {
[recipe_name] = {
test = function(cooker, names, tags) -- Ingredient requirements
priority = number, -- Recipe selection priority
foodtype = FOODTYPE, -- Primary food classification
health = number, -- Health restoration value
hunger = number, -- Hunger restoration value
sanity = number, -- Sanity change value
perishtime = number, -- Spoilage duration
cooktime = number, -- Cooking time required
-- Optional special properties...
}
}

Recipe Categories

Basic Sustenance Recipes

meatballs

Status: stable

Description: Basic meat dish with minimal ingredient requirements.

Test Conditions:

function(cooker, names, tags)
return tags.meat and not tags.inedible
end

Properties:

  • Priority: -1 (fallback recipe)
  • Health: TUNING.HEALING_SMALL
  • Hunger: TUNING.CALORIES_SMALL * 5
  • Pot Level: high

ratatouille

Status: stable

Description: Basic vegetable dish for vegetarian sustenance.

Test Conditions:

function(cooker, names, tags)
return not tags.meat and tags.veggie and tags.veggie >= 0.5 and not tags.inedible
end

Properties:

  • Priority: 0
  • Foodtype: FOODTYPE.VEGGIE

Specialty Meat Dishes

honeyham

Status: stable

Description: Premium meat dish with honey enhancement.

Test Conditions:

function(cooker, names, tags)
return names.honey and tags.meat and tags.meat > 1.5 and not tags.inedible
end

Properties:

  • Health: TUNING.HEALING_MEDLARGE
  • Hunger: TUNING.CALORIES_HUGE
  • Temperature: TUNING.HOT_FOOD_BONUS_TEMP
  • Temperature Duration: TUNING.FOOD_TEMP_AVERAGE
  • Tags: honeyed

surfnturf

Status: stable

Description: Luxury dish combining meat and fish for maximum benefits.

Test Conditions:

function(cooker, names, tags)
return tags.meat and tags.meat >= 2.5
and tags.fish and tags.fish >= 1.5
and not tags.frozen
end

Properties:

  • Priority: 30
  • Health: TUNING.HEALING_HUGE
  • Hunger: TUNING.CALORIES_LARGE
  • Sanity: TUNING.SANITY_LARGE
  • Pot Level: high

Desserts and Treats

icecream

Status: stable

Description: Frozen dessert providing significant sanity restoration and cooling.

Test Conditions:

function(cooker, names, tags)
return tags.frozen and tags.dairy and tags.sweetener
and not tags.meat and not tags.veggie and not tags.inedible and not tags.egg
end

Properties:

  • Foodtype: FOODTYPE.GOODIES
  • Sanity: TUNING.SANITY_HUGE
  • Temperature: TUNING.COLD_FOOD_BONUS_TEMP
  • Temperature Duration: TUNING.FOOD_TEMP_LONG
  • Perish Time: TUNING.PERISH_SUPERFAST

jellybean

Status: stable

Description: Special confection providing health regeneration over time.

Test Conditions:

function(cooker, names, tags)
return names.royal_jelly and not tags.inedible and not tags.monster
end

Special Properties:

  • Non-perishable (perishtime = nil)
  • Stackable (stacksize = 3)
  • Health regeneration buff via oneatenfn
  • Tags: honeyed

Unique Effect Recipes

mandrakesoup

Status: stable

Description: Powerful soup made from mandrake with exceptional restorative properties.

Test Conditions:

function(cooker, names, tags)
return names.mandrake
end

Properties:

  • Priority: 10
  • Health: TUNING.HEALING_SUPERHUGE
  • Hunger: TUNING.CALORIES_SUPERHUGE
  • Perish Time: TUNING.PERISH_FAST

shroomcake

Status: stable

Description: Magical cake that provides sleep resistance and immunity.

Test Conditions:

function(cooker, names, tags)
return names.moon_cap and names.red_cap and names.blue_cap and names.green_cap
end

Special Effects:

  • Resets grogginess
  • Applies sleep resistance and immunity buffs
  • Requires all four mushroom cap types

Monster Food

monsterlasagna

Status: stable

Description: Unappetizing dish made primarily from monster meat.

Test Conditions:

function(cooker, names, tags)
return tags.monster and tags.monster >= 2 and not tags.inedible
end

Properties:

  • Health: -TUNING.HEALING_MED (negative)
  • Sanity: -TUNING.SANITY_MEDLARGE (negative)
  • Foodtype: FOODTYPE.MEAT
  • Secondary Foodtype: FOODTYPE.MONSTER
  • Tags: monstermeat

Special Utility Foods

powcake

Status: stable

Description: Long-lasting emergency ration with poor taste but infinite shelf life.

Test Conditions:

function(cooker, names, tags)
return names.twigs and names.honey
and (names.corn or names.corn_cooked or names.oceanfish_small_5_inv or names.oceanfish_medium_5_inv)
end

Properties:

  • Health: -TUNING.HEALING_SMALL (negative)
  • Hunger: 0
  • Perish Time: 9000000 (effectively infinite)
  • Tags: honeyed, donotautopick

Beefalo Feed

beefalofeed

Status: stable

Description: Basic feed suitable for beefalo consumption.

Test Conditions:

function(cooker, names, tags)
return tags.inedible and not tags.monster and not tags.meat
and not tags.fish and not tags.egg and not tags.fat
and not tags.dairy and not tags.magic
end

Properties:

  • Priority: -5
  • Foodtype: FOODTYPE.ROUGHAGE
  • Secondary Foodtype: FOODTYPE.WOOD
  • Special cookbook behavior for beefalo

beefalotreat

Status: stable

Description: Premium beefalo feed with enhanced nutrition.

Properties:

  • Priority: -4
  • Health: TUNING.HEALING_MOREHUGE
  • Pot Level: high

Recipe Properties System

Standard Properties

All recipes include these fundamental properties:

PropertyTypeDefaultDescription
namestringkeyRecipe identifier
weightnumber1Recipe weight for selection
prioritynumber0Selection priority (higher wins)
cookbook_categorystring"cookpot"Recipe book categorization

Nutritional Properties

PropertyTypeDescription
healthnumberHealth points restored (can be negative)
hungernumberHunger points restored
sanitynumberSanity points changed (can be negative)
perishtimenumberTime before spoilage (nil = non-perishable)

Cooking Properties

PropertyTypeDescription
cooktimenumberTime required to cook
potlevelstringRequired pot upgrade level
overridebuildstringCustom visual appearance

Special Effect Properties

PropertyTypeDescription
temperaturenumberTemperature change applied to eater
temperaturedurationnumberDuration of temperature effect
oneatenfnfunctionCustom function executed when consumed
prefabstableRequired prefabs for special effects
oneat_descstringDescription of eating effects

Food Type Classifications

Primary Food Types

  • FOODTYPE.MEAT: Meat-based dishes
  • FOODTYPE.VEGGIE: Vegetarian dishes
  • FOODTYPE.GOODIES: Desserts and treats
  • FOODTYPE.ROUGHAGE: Animal feed

Secondary Food Types

  • FOODTYPE.MONSTER: Monster meat content
  • FOODTYPE.WOOD: Woody content for animals
  • FOODTYPE.ELEMENTAL: Special elemental foods

Recipe Testing System

Ingredient Matching

The recipe system uses test functions to match ingredients:

test = function(cooker, names, tags)
-- Check for specific named ingredients
if names.specific_ingredient then
-- Specific ingredient check
end

-- Check ingredient tag totals
if tags.category and tags.category >= minimum then
-- Category requirement met
end

-- Check exclusions
if not tags.unwanted or tags.unwanted < maximum then
-- Unwanted ingredients within limits
end

return all_conditions_met
end

Priority Resolution

When multiple recipes match the same ingredients:

  1. Higher priority numbers take precedence
  2. Equal priorities may result in random selection
  3. Negative priorities serve as fallback options

Common Ingredient Tags

TagDescriptionExamples
meatMeat content valueRaw meat, cooked meat
veggieVegetable content valueCarrots, potatoes
fruitFruit content valueBerries, dragon fruit
fishFish content valueFish meat, eels
eggEgg content valueBird eggs, tall bird eggs
dairyDairy content valueButter, milk
sweetenerSweetening contentHoney, royal jelly
frozenFrozen content valueIce, frozen foods
inedibleInedible content valueTwigs, stones
monsterMonster content valueMonster meat

Special Effects Implementation

Temperature Effects

Many recipes provide temporary temperature modifications:

-- Hot food example
temperature = TUNING.HOT_FOOD_BONUS_TEMP,
temperatureduration = TUNING.FOOD_TEMP_LONG,

-- Cold food example
temperature = TUNING.COLD_FOOD_BONUS_TEMP,
temperatureduration = TUNING.FOOD_TEMP_AVERAGE,

Buff Application

Some recipes apply temporary character buffs:

oneatenfn = function(inst, eater)
eater:AddDebuff("buff_name", "buff_name")
end,
prefabs = { "buff_prefab_name" },

Stat Manipulation

Advanced recipes can directly modify character statistics:

oneatenfn = function(inst, eater)
if eater.components.sanity ~= nil then
eater.components.sanity:DoDelta(amount)
end
end

Visual Customization

Override Builds

Some recipes use custom visual appearances:

overridebuild = "cook_pot_food2", -- Custom food appearance

Floating Parameters

Animation parameters for food items:

floater = {"size", y_offset, scale}, -- Animation configuration

Recipe Integration Examples

Creating a New Recipe

local new_recipe = {
test = function(cooker, names, tags)
return names.custom_ingredient and tags.meat >= 1
end,
priority = 15,
foodtype = FOODTYPE.MEAT,
health = TUNING.HEALING_MED,
hunger = TUNING.CALORIES_LARGE,
sanity = TUNING.SANITY_SMALL,
perishtime = TUNING.PERISH_MED,
cooktime = 1.0,
potlevel = "high"
}

Testing Recipe Matches

-- Simulate ingredient collection
local test_ingredients = {
names = {meat = 2, berries = 1, honey = 1},
tags = {meat = 2, fruit = 1, sweetener = 1}
}

-- Test against honeyham recipe
if foods.honeyham.test(nil, test_ingredients.names, test_ingredients.tags) then
print("Can make honey ham!")
end

Notes

  • Recipe priority determines selection when multiple recipes match
  • All recipes are categorized as "cookpot" for the standard cookbook
  • Temperature effects provide gameplay benefits beyond nutrition
  • Special effect recipes often require rare ingredients as balance mechanisms
  • The donotautopick tag prevents certain recipes from being auto-selected
  • Monster food provides high hunger but negative health/sanity as a trade-off
  • Some recipes have stacksize limitations for balance purposes