Wormlight Plant
Based on game build 714014 | Last updated: 2026-03-07
Overview
The wormlight_plant is a world entity that functions as a renewable light source and resource. It uses the pickable component to enable harvesting, which temporarily extinguishes its light and replaces the plant with a "picked" visual state. After a regen time defined by TUNING.WORMLIGHT_PLANT_REGROW_TIME, it regrows and reactivates its light. It also serves as fuel for fire via burnable components and can ignite nearby entities due to propagation and hauntability traits.
Usage example
-- Typically instantiated internally by the game world, but for testing:
local inst = Prefab("wormlight_plant")
inst:AddComponent("pickable")
inst.components.pickable.picksound = "dontstarve/wilson/pickup_reeds"
inst.components.pickable:SetUp("wormlight_lesser", TUNING.WORMLIGHT_PLANT_REGROW_TIME)
Dependencies & tags
Components used: pickable, lootdropper, inspectable
Tags: Adds plant
Properties
No public properties.
Main functions
Not applicable — this is a prefab definition, not a component. Core behavior is implemented via pickable component hooks (see Events & listeners).
Events & listeners
- Listens to: None directly; relies on
pickablecomponent events. - Pushes: None directly; leverages
pickable'sonpickedfn,onregenfn, andmakeemptyfnhooks to drive visual states:onpickedfn: Plays "picking" animation, transitions to "picked", disables light.onregenfn: Plays "grow" animation, transitions to "berry_idle", enables light after ~8 frames.makeemptyfn: Same visual effect asonpickedfn, used when item is picked with a tool that empties the object.