Skip to main content

Milkywhites

Based on game build 714014 | Last updated: 2026-03-06

Overview

The milkywhites prefab represents a consumable item in the inventory system used as cat food. It is a stackable, perishable food item that grants small health and hunger restoration but causes a moderate sanity loss when consumed. It is intended for use by cat-like characters (e.g., Webber) to avoid sanity penalties or to gain food benefits. It is created using the Prefab system and sets up default components including edible, perishable, stackable, inventoryitem, tradable, and inspectable.

Usage example

local inst = SpawnPrefab("milkywhites")
inst.components.edible.healthvalue = TUNING.HEALING_MEDSMALL
inst.components.edible.hungervalue = TUNING.CALORIES_SMALL
inst.components.edible.sanityvalue = -TUNING.SANITY_MEDLARGE
inst.components.stackable.maxsize = TUNING.STACK_SIZE_SMALLITEM
inst.components.perishable:SetPerishTime(TUNING.PERISH_MED)

Dependencies & tags

Components used: edible, perishable, stackable, inventoryitem, inspectable, tradable
Tags: Adds catfood

Properties

PropertyTypeDefault ValueDescription
healthvaluenumberTUNING.HEALING_MEDSMALLHealth restored on consumption.
hungervaluenumberTUNING.CALORIES_SMALLHunger restored on consumption.
sanityvaluenumber-TUNING.SANITY_MEDLARGESanity change on consumption (negative value indicates loss).
maxsizenumberTUNING.STACK_SIZE_SMALLITEMMaximum stack size for the item.
onperishreplacementstring"spoiled_food"Prefab name to replace this item when it spoils.
perishtimenumberTUNING.PERISH_MEDTime in seconds before the item spoils.

Main functions

None (the component logic is purely declarative setup in the constructor; no custom methods are defined in this file beyond standard component usage.)

Events & listeners

None identified.