Skip to main content

Driedplants Defs

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

Overview

driedplants_defs.lua defines the data structures for dried plant items used in the game’s food system. Each entry specifies properties such as health restoration, sanity impact, and animation/sound assets (bank and build) to use when the item is consumed. The definitions are collected into a single plants table and returned for use by food-related prefabs and crafting recipes.

This file is not an ECS component but a configuration data file — it provides reusable definitions for dried/desiccated plant consumables.

Usage example

-- Access dried plant definitions via the returned table
local dried_plants = require "prefabs/driedplants_defs"

-- Example: retrieve the definition for firenettles
local firenettle_def = dried_plants.plants.firenettles_dried
-- Note: Actual key lookup uses the *dried* name variant (see comments in code)

Dependencies & tags

Components used: None identified.
Tags: None identified.

Properties

The module returns a single table with the following top-level structure:

PropertyTypeDefault ValueDescription
plantstable of tablesDRIED_DEFSArray of dried plant definition tables. Each table contains optional fields for name, healthvalue, sanityvalue, bank, build, and oneaten callback.

Each entry in plants may include:

PropertyTypeDescription
namestringBase name for the dried item (e.g., "petals"). Actual prefab names use the suffix _dried.
healthvaluenumberHealth restored when eaten (positive or negative).
sanityvaluenumberSanity impact when eaten (positive or negative).
bankstringOptional SoundBank name override for eating audio.
buildstringOptional asset build name override for eating visual FX.
oneatenfunction(inst, eater)Optional callback executed after eating. Receives the eaten item (inst) and eater entity (eater).

Main functions

No functions defined in this file. This is a pure data definition module.

Events & listeners

Not applicable.