Lavae Tooth
Based on game build 714014 | Last updated: 2026-03-05
Overview
lavae_tooth is a prefab that functions as a visual and logical placeholder for the Lavae boss's pet-spawning mechanism. It exists as a small, floating inventory item (an "egg tooth") and enables controlled spawning of the lavae_pet via the petleash component. When removed (e.g., via despawn or ownership loss), it triggers a cleanup sequence that spawns small_puff FX, converts itself to ash, and attempts to return the ash to its original inventory/container slot if available. This prefab is integral to the Lavae boss fight progression.
Usage example
-- Typically created internally via the prefab system
local tooth = SpawnPrefab("lavae_tooth")
-- When attached to a Lavae entity (e.g., as a boss token), the petleash component manages pet lifecycle
if tooth.components.petleash then
tooth.components.petleash:SpawnPet() -- triggers OnSpawnFn (see below)
end
Dependencies & tags
Components used: inventoryitem, inspectable, leader, petleash, transform, animstate, network
Tags: Adds donotautopick
Prefabs spawned: lavae_pet, small_puff, ash
Properties
| Property | Type | Default Value | Description |
|---|---|---|---|
nospawnfx | boolean | nil | When truthy, suppresses spawnFX (small_puff) on pet spawn. |
Main functions
OnSpawn(inst, pet)
- Description: Executed when the
lavae_petis spawned. Plays a spawn FX (small_puff) unlessnospawnfxis set, and registers a listener for the pet'sonremoveevent to trigger cleanup. - Parameters:
inst(Entity) — thelavae_toothinstance.
pet(Entity) — the spawnedlavae_pet. - Returns: Nothing.
OnDespawn(inst, pet)
- Description: Executed when the
lavae_petis removed manually or via despawn. Spawnssmall_puffFX, clears theonremovelistener, and destroys the pet entity. - Parameters:
inst(Entity) — thelavae_toothinstance.
pet(Entity) — the despawnedlavae_pet. - Returns: Nothing.
OnPetLost(inst, pet)
- Description: Called when the
lavae_petis removed. Spawnsash, attempts to retain inventory slot position if the original owner had an inventory or container, and emits a sound. This ensures ash remains contextually placed (e.g., in player inventory). - Parameters:
inst(Entity) — thelavae_toothinstance.
pet(Entity) — the lostlavae_pet. - Returns: Nothing.
Events & listeners
- Listens to:
onremove(on thelavae_petinstance) — triggersOnPetLostwhen the pet is removed. - Pushes: None identified.