playItemSound⚓︎
This event is triggered when the game is about to play a sound when an item gets added or removed from an inventory, or when eaten or consumed. Can be blocked to play custom sound instead.
--- @param e playItemSoundEventData
local function playItemSoundCallback(e)
end
event.register(tes3.event.playItemSound, playItemSoundCallback)
Tip
This event can be filtered based on the item event data.
Tip
This event supports blocking by setting e.block to true or returning false. Blocking the event prevents vanilla behavior from happening. For example, blocking an equip event prevents the item from being equipped.
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⚓︎
item(tes3baseObject): Read-only. The item for which the sound is about to be played.reference(tes3reference): Read-only. The actor reference that picked or dropped the item that's now about to play the sound.state(tes3.itemSoundState): Read-only. Maps to values in tes3.itemSoundState namespace.