Itemmimic Revealed
Based on game build 722832 | Last updated: 2026-04-18
Overview
itemmimic_revealed is a prefab that spawns the revealed combat form of the Item Mimic enemy. It includes health, locomotion, loot dropping, player proximity detection, sanity aura, and timer components. The prefab also spawns a shadow VFX child entity (itemmimic_revealed_shadow) that renders particle effects. This prefab is server-authoritative for combat logic while the shadow effect is client-side only.
Usage example
-- Spawn the revealed mimic
local inst = SpawnPrefab("itemmimic_revealed")
-- Configure loot behavior
inst.SetNoLoot(inst, true) -- Disable loot drop
local hasNoLoot = inst.GetNoLoot(inst)
-- Save/Load support
local saveData = {}
inst.OnSave(inst, saveData)
inst.OnLoad(inst, saveData)
Dependencies & tags
External dependencies:
brains/itemmimic_revealedbrain-- AI behavior tree attached to the entity
Components used:
health-- manages entity health and death statelocomotor-- controls movement speed and creep behaviorlootdropper-- manages loot table on deathplayerprox-- detects nearby players for step-on dispersalsanityaura-- applies sanity drain to nearby playerstimer-- manages mimic blocker and stepping delay timersknownlocations-- tracks entity location knowledge
Tags:
shadowcreature-- added on creationmonster-- added on creationhostile-- added on creationshadow-- added on creationnotraptrigger-- added on creationshadow_aligned-- added on creationitemmimic_revealed-- added on creation
Properties
| Property | Type | Default Value | Description |
|---|---|---|---|
noloot | boolean | nil | Whether the entity drops loot on death. |
_shadow_tail | entity | nil | Reference to the shadow VFX child entity (client-only). |
_toggle_tail_event | net_event | nil | Network event for toggling shadow tail visibility. |
scrapbook_anim | string | "eye_idle" | Animation name for scrapbook display. |
scrapbook_hidehealth | boolean | true | Whether to hide health in scrapbook UI. |
Main functions
SetNoLoot(inst, noloot)
- Description: Configures whether the entity drops loot on death. Sets the loot table to empty or default based on the flag.
- Parameters:
inst-- entity instancenoloot-- boolean to enable/disable loot dropping
- Returns: None
- Error states: Errors if
insthas nolootdroppercomponent (nil dereference oninst.components.lootdropper-- no guard present).
GetNoLoot(inst)
- Description: Returns the current loot drop configuration state.
- Parameters:
inst-- entity instance - Returns: Boolean value of
inst.noloot - Error states: None
OnLoad(inst, data)
- Description: Restores saved state when the entity is loaded from a save file. Applies the
nolootsetting if present in save data. - Parameters:
inst-- entity instancedata-- table containing saved state
- Returns: None
- Error states: None (handles nil
datagracefully)
OnSave(inst, data)
- Description: Saves current state to a table for persistence. Stores the
nolootflag. - Parameters:
inst-- entity instancedata-- table to populate with save data
- Returns: None
- Error states: None
on_eye_up(inst)
- Description: Plays eye appearance animation and sound when the
eye_upevent fires. Only activates if the entity is not dead. - Parameters:
inst-- entity instance - Returns: None
- Error states: None (checks
IsDead()before playing animation)
on_eye_down(inst)
- Description: Plays eye disappearance animation when the
eye_downevent fires. - Parameters:
inst-- entity instance - Returns: None
- Error states: None
DisperseFromBeingSteppedOn(inst, player)
- Description: Kills the entity when a player steps on it. Pushes a
killedevent to the player if present. - Parameters:
inst-- entity instanceplayer-- player entity that stepped on it (can be nil)
- Returns: None
- Error states: Errors if
insthas nohealthcomponent (nil dereference oninst.components.health:Kill()-- no guard present).
toggle_tail(inst)
- Description: Toggles the disabled state of the shadow tail VFX entity.
- Parameters:
inst-- entity instance - Returns: None
- Error states: None (checks
inst._shadow_tailbefore accessing)
on_death(inst, data)
- Description: Pushes the toggle tail event when the entity dies.
- Parameters:
inst-- entity instancedata-- event data (unused)
- Returns: None
- Error states: None
on_jump_spawn(inst)
- Description: Starts the
recently_spawnedtimer if it does not already exist when thejumpevent fires. - Parameters:
inst-- entity instance - Returns: None
- Error states: Errors if
insthas notimercomponent (nil dereference oninst.components.timer-- no guard present).
on_timer_done(inst, data)
- Description: Sets up player proximity detection when the
stepping_delaytimer completes. - Parameters:
inst-- entity instancedata-- table containingnamefield with timer name
- Returns: None
- Error states: Errors if
insthas noplayerproxcomponent (nil dereference oninst.components.playerprox-- no guard present).
Events & listeners
- Listens to:
eye_up-- triggers eye appearance animation - Listens to:
eye_down-- triggers eye disappearance animation - Listens to:
death-- triggers shadow tail event push - Listens to:
timerdone-- sets up player proximity detection on stepping_delay completion - Listens to:
jump-- starts recently_spawned timer - Listens to:
itemmimic_revealed.toggle_tail_event-- toggles shadow tail visibility (client-only) - Pushes:
killed-- pushed to player entity when stepped on (viaplayer:PushEvent)