Skip to main content

Saltrock

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

Overview

saltrock is a prefab representing a consumable item in the game. It functions as a food item with low nutritional value, a preservative agent, and a repair material. It is also used as bait for moles. The component logic resides primarily in the fn() prefab constructor, which attaches multiple standard DST components: edible, stackable, preservative, and repairer. Networked properties are configured via standard ECS patterns.

Usage example

local inst = SpawnPrefab("saltrock")
-- Configure or interact with its components
inst.components.edible:Feed(entity, 1) -- consume it
inst.components.preservative:GetPreservationBonus() -- get preservation multiplier
inst.components.repairer:Repair(item, 1) -- repair an item

Dependencies & tags

Components used: bait, inspectable, inventoryitem, tradable, edible, stackable, preservative, repairer
Tags: Adds molebait (used by mole AI to detect bait)

Properties

PropertyTypeDefault ValueDescription
foodtypeFOODTYPEFOODTYPE.ELEMENTALClassification of the food for hunger and effects.
hungervaluenumber1Hunger restored when consumed.
maxsizenumberTUNING.STACK_SIZE_SMALLITEMMaximum stack size.
percent_increasenumberTUNING.SALTROCK_PRESERVE_PERCENT_ADDBonus preservation percentage when used as a preservative.
repairmaterialMATERIALSMATERIALS.SALTMaterial type used for repair calculations.
finiteusesrepairvaluenumberTUNING.SALTLICK_IMPROVED_MAX_LICKS / CACHED_SALT_LICK_IMPROVED_RECIPE_COSTNumber of repair uses per item.

Main functions

None identified. This prefab only initializes components in the constructor and does not define custom methods.

Events & listeners

None identified. No events are directly listened to or pushed by this prefab’s logic.