Skip to main content

Beequeen

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

Overview

beequeen is a prefab file that defines the Beequeen boss entity for Don't Starve Together. It configures the entity with multiple components for combat behavior, health-based phase transitions (4 phases), honey trail spawning, commander functionality for bee guards, and player tracking systems. The prefab integrates with the brain system for AI behavior and stategraph for animation control.

Usage example

-- Spawn Beequeen in the world
local beequeen = SpawnPrefab("beequeen")

-- Access phase configuration
beequeen.focustarget_cd = TUNING.BEEQUEEN_FOCUSTARGET_CD[2]

-- Control honey trail system
beequeen:StartHoney()
beequeen:StopHoney()

-- Boost commander range for guard spawning
beequeen:BoostCommanderRange(true)

Dependencies & tags

Components used: combat, commander, epicscare, freezable, grouptargeter, health, healthtrigger, inspectable, knownlocations, locomotor, lootdropper, sleeper, stuckdetection, timer, sanityaura, explosiveresist

Tags: Adds epic, noepicmusic, bee, beequeen, insect, monster, hostile, scarytoprey, largecreature, flying, ignorewalkableplatformdrowning

Properties

PropertyTypeDefault ValueDescription
focustarget_cdnumberPhase-dependentCooldown for focus target selection based on current phase
spawnguards_cdnumberPhase-dependentCooldown for spawning bee guards based on current phase
spawnguards_maxchainnumberPhase-dependentMaximum chain length for guard spawning based on current phase
spawnguards_thresholdnumberPhase-dependentThreshold for guard spawning based on current phase
honeytasktasknilPeriodic task reference for honey trail spawning
honeycountnumber0Counter for honey trail spawn timing
honeythresholdnumber0Threshold value for honey trail spawning
usedhoneytable{}Array of recently used honey variations
availablehoneytable{1..7}Array of available honey variation indices
commanderboostbooleanfalseWhether commander range is currently boosted
commandertasktasknilPeriodic task for updating commander range
_playingmusicbooleanfalseWhether Beequeen music is currently playing for nearby player
_sleeptasktasknilDelayed removal task when entity sleeps
hit_recoverynumberTUNING.BEEQUEEN_HIT_RECOVERYRecovery time after being hit
spawnguards_chainnumber0Current chain count for guard spawning

Main functions

BoostCommanderRange(boost)

  • Description: Enables or disables extended commander tracking distance for bee guard spawning. When boosted, tracking distance increases to 80 units; otherwise returns to default 40 units.
  • Parameters: boost (boolean) - Whether to enable boosted range.
  • Returns: Nothing.
  • Error states: Cancels existing commandertask if boost is enabled.

StartHoney()

  • Description: Initiates the periodic honey trail spawning system. Sets initial threshold and count values, then starts a periodic task that spawns honey trails based on movement state.
  • Parameters: None.
  • Returns: Nothing.
  • Error states: Returns early if honeytask is already active.

StopHoney()

  • Description: Cancels the honey trail spawning periodic task.
  • Parameters: None.
  • Returns: Nothing.
  • Error states: Returns early if honeytask is nil.

OnSave(data)

  • Description: Serializes Beequeen state for save files. Stores commander tracking distance if boosted.
  • Parameters: data (table) - Save data table to populate.
  • Returns: Nothing.

OnLoad(data)

  • Description: Restores Beequeen state from save files. Determines current phase based on health percentage and restores commander boost state.
  • Parameters: data (table) - Loaded save data table.
  • Returns: Nothing.

OnEntitySleep()

  • Description: Handles entity sleep state. Schedules entity removal after 10 seconds if not dead, and cancels commander update task.
  • Parameters: None.
  • Returns: Nothing.

OnEntityWake()

  • Description: Handles entity wake state. Cancels sleep removal task and restores commander boost state.
  • Parameters: None.
  • Returns: Nothing.

Events & listeners

  • Listens to: attacked - Triggers target acquisition and shares target with all bee guards via commander component.
  • Listens to: onattackother - Resets stuck detection and spawns honey trail at target location.
  • Listens to: onmissother - Spawns honey trail at attack range distance in facing direction.
  • Pushes: screech - Fired when entering phases 2, 3, or 4 (health thresholds at 75%, 50%, 25%).
  • Pushes: triggeredevent (to player) - Fired when player is near Beequeen to trigger boss music.