Marsh Bush
Based on game build 714014 | Last updated: 2026-03-05
Overview
marsh_bush is a static, harvestable environment entity in the prefabs system. It implements core gameplay behaviors for a thorny plant: players or creatures can pick it for twigs, but they risk taking damage from its thorns unless protected. The prefab uses the pickable, workable, and lootdropper components to manage harvesting, digging, and loot drops, while integrating with burnable and hauntable systems for environmental interactions.
This prefab also defines two additional variants—burnt_marsh_bush and burnt_marsh_bush_erode—to handle post-burn states, including activation-based ash generation and visual erosion effects.
Usage example
local inst = SpawnPrefab("marsh_bush")
inst.Transform:SetPosition(x, y, z)
-- Harvest twigs manually via workable (e.g., dig action)
inst.components.workable:DoWork()
-- Or pick directly (triggers damage unless protected)
inst.components.pickable:Pick(picker)
Dependencies & tags
Components used:
pickable— manages harvest state, regeneration, and callbackslootdropper— spawns loot (twigs,dug_marsh_bush,ash)workable— enables dig action viaACTIONS.DIGhauntable— sets haunt value for burnt variantactivatable— handles burnt bush activationinspectable— adds description and tooltip support
Tags added:
plant,thorny,silviculture(onmarsh_bush)plant,thorny,burnt,NOCLICK(on burnt variants)FX(on erosion effects)
Properties
No public properties are defined in this prefab. State is managed entirely through component interfaces and internal functions.
Main functions
onpickedfn(inst, picker)
- Description: Callback invoked when the marsh bush is picked. Plays a picking animation, damages the picker unless they have
bramble_resistantgear or are ashadowminion, and emits a thorns event. - Parameters:
inst(Entity) — the marsh bush instancepicker(Entity?) — the entity attempting to pick; may benil
- Returns: Nothing.
- Error states: No damage occurs if
pickerisnil, hasbramble_resistanttag on equipped item, or is ashadowminion.
dig_up(inst, chopper)
- Description: Callback executed upon finishing a dig work action. Drops
twigs(if pickable) anddug_marsh_bush, then removes the entity. - Parameters:
inst(Entity) — the marsh bush instancechopper(Entity) — the actor performing the dig action
- Returns: Nothing.
OnActivateBurnt(inst)
- Description: Activation handler for burnt marsh bushes. Schedules ash generation, tags as
NOCLICK, marks non-persistent, triggers erosion, and spawns a burnt erosion FX entity. - Parameters:
inst(Entity) — the burnt marsh bush instance - Returns: Nothing.
Events & listeners
- Listens to:
animover— on erosion FX entity, triggersinst:Remove()after animation completes. - Pushes:
thorns— fired on the picker after thorn damage is applied (client/server).