Bedazzler
Based on game build 714014 | Last updated: 2026-03-03
Overview
Bedazzler is a utility component that encapsulates the logic for applying the bedazzlement status effect to eligible entities. It validates target conditions (e.g., not burning, not frozen, not already bedazzled) before triggering bedazzlement:Start(). This component is typically attached to items used to bedazzle entities (e.g., the Bedazzle Staff), and optionally consumes uses from a finiteuses component.
Usage example
local inst = CreateEntity()
inst:AddComponent("bedazzler")
inst:AddComponent("finiteuses")
inst.components.bedazzler:SetUseAmount(1)
local target = some_spider_den_entity
if inst.components.bedazzler:CanBedazzle(target) == true then
inst.components.bedazzler:Bedazzle(target)
end
Dependencies & tags
Components used: burnable, freezable, bedazzlement, finiteuses.
Tags: Checks burnt, bedazzled.
Properties
| Property | Type | Default Value | Description |
|---|---|---|---|
use_amount | number | 1 | Number of uses to consume from finiteuses when bedazzling. Set via SetUseAmount(). |
Main functions
SetUseAmount(use_amount)
- Description: Configures how many uses to deduct from the
finiteusescomponent during bedazzlement. Defaults to1ifuse_amountis not set and the bedazzler is used. - Parameters:
use_amount(number) - number of uses to consume per bedazzle action. - Returns: Nothing.
CanBedazzle(target)
- Description: Checks whether the specified target entity can be bedazzled, based on its current state and tags.
- Parameters:
target(Entity) - the entity to evaluate. - Returns:
trueif the target is eligible.false, "REASON"(string) if ineligible, whereREASONis one of:"BURNING","BURNT","FROZEN","ALREADY_BEDAZZLED".
- Error states: Returns early with
falseif any condition prevents bedazzlement.
Bedazzle(target)
- Description: Applies the bedazzlement effect to the target entity and, if present, consumes uses from the bedazzler’s
finiteusescomponent. - Parameters:
target(Entity) - the entity to bedazzle. - Returns: Nothing.
- Error states: Does nothing if
target.components.bedazzlementis missing. Consumption of uses occurs only if the bedazzler entity itself has afiniteusescomponent.
Events & listeners
None identified.