magicCasted⚓︎
This event is triggered when any spell or enchant is cast successfully, or when any alchemy item is used. This includes spells cast via scripts. For spells, this occurs at the end of the casting animation. For spells and enchants, it is just after the magic projectile has been constructed.
--- @param e magicCastedEventData
local function magicCastedCallback(e)
end
event.register(tes3.event.magicCasted, magicCastedCallback)
Tip
An event can be claimed by setting e.claim
to true
, or by returning false
from the callback. Claiming the event prevents any lower priority callbacks from being called.
Event Data⚓︎
caster
(tes3reference): Read-only. The caster of the spell.source
(tes3alchemy, tes3enchantment, tes3spell): Read-only. The magic source.sourceInstance
(tes3magicSourceInstance): Read-only. The unique instance of the magic source.target
(tes3reference): Read-only. The target of the spell. For self-targeted spells, this matches the caster. Touch spells can also havetarget
parameter. On target spells don't havetarget
parameter during this event, since it can't have a target until it hits it. Which isn't known when the spell is casted.