Skip to main content

Stalagmite

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

Overview

stalagmite is a reusable prefab template for breakable rock formations that provides mining interactions, dynamic loot tables, and visual feedback. It implements the workable, lootdropper, and inspectable components and is extended into three variants: stalagmite_full, stalagmite_med, and stalagmite_low. It integrates with the spooked component to trigger Halloween-themed effects when a spooked player mines it.

Usage example

local inst = SpawnPrefab("stalagmite_full")
inst.Transform:SetPosition(x, y, z)
inst:AddTag("worldspawn")

Dependencies & tags

Components used: lootdropper, workable, inspectable, spooked (indirect via callback), burnable, fueled (checked conditionally in lootdropper.lua) Tags: Adds boulder; checks burnt, burnable, fueled, structure, monster, animal, creaturecorpse, hive

Properties

PropertyTypeDefault ValueDescription
scrapbook_animstring"full"Animation state name used in scrapbook illustrations.
workable.workleftnumberTUNING.ROCKS_MINE, TUNING.ROCKS_MINE_MED, or TUNING.ROCKS_MINE_LOWRemaining work required to fully break the stalagmite.
workable.actionstring"MINE"Action name displayed in the UI for mining interactions.
lootdropper.chanceloottablestring'full_rock', 'med_rock', or 'low_rock'Loot table key determining possible loot outcomes.

Main functions

workcallback(inst, worker, workleft)

  • Description: Callback invoked on each mining tick. Decreases remaining work, plays an appropriate animation (low, med, or full), triggers Halloween spook effects, and removes the stalagmite upon completion while dropping loot.
  • Parameters:
    • inst (Entity) — The stalagmite instance.
    • worker (Entity) — The entity performing the mining.
    • workleft (number) — Remaining work required to break the stalagmite.
  • Returns: Nothing.
  • Error states: If workleft <= 0, the stalagmite is destroyed; otherwise, animation updates occur only if the current animation doesn’t match the expected one for the current work level.

Events & listeners

  • Listens to: None (dependencies are invoked via direct method calls).
  • Pushes: rock_break_fx is spawned at position; entity_droploot is pushed via lootdropper:DropLoot().