# new RezEffect()
Represents an effect in the Rez game engine. Effects are typically applied to or removed from objects when items are equipped, consumed, or used. They can modify object attributes, add temporary abilities, or trigger events.
Extends
Methods
# static apply(ownerId, itemId, locationopt) → {*}
Applies this effect to the specified object by running the
on_apply event handler with {owner_id, item_id, inventory_id, slot_id, position}
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
ownerId |
string
|
ID of the object this effect is being applied to |
|
itemId |
string
|
ID of the item that has this effect |
|
location |
object
|
<optional> |
where the item is, when the effect comes from an
item in an inventory: |
result of the apply event handler
*
# static constructor(id, attributes)
Creates a new effect instance
Parameters:
| Name | Type | Description |
|---|---|---|
id |
string
|
unique identifier for this effect |
attributes |
object
|
effect attributes from Rez compilation |
# static remove(ownerId, itemId, locationopt) → {*}
Removes this effect from the specified object by running the
on_remove event handler with {owner_id, item_id, inventory_id, slot_id, position}
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
ownerId |
string
|
ID of the object this effect is being removed from |
|
itemId |
string
|
ID of the item that has this effect |
|
location |
object
|
<optional> |
where the item was, when the effect came from an
item in an inventory: |
result of the remove event handler
*