Skip to content

bodyPartAssigned⚓︎

Allows reading and overwriting body part assignments.

--- @param e bodyPartAssignedEventData
local function bodyPartAssignedCallback(e)
end
event.register(tes3.event.bodyPartAssigned, bodyPartAssignedCallback)

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⚓︎

  • bodyPart (tes3bodyPart): The body part object assigned.
  • index (tes3.activeBodyPart): Read-only. The body slot index of the newly assigned body part. Maps to values in tes3.activeBodyPart constants.
  • isFirstPerson (boolean): Read-only. A flag that controls whether the newly assigned body part is used while the camera is in the first person.
  • manager (tes3bodyPartManager): Read-only. The access to the body part manager that is associated with the reference that had a body part assigned.
  • object (tes3physicalObject): Read-only. Access to the physical object for the assigned body part.
  • reference (tes3reference): Read-only. The reference for the actor whose body part was assigned.

Examples⚓︎

Example: Bald is beautiful

This example shows how to disable hair body parts from appearing on NPCs or the Player.

---@param e bodyPartAssignedEventData
local function baldIsBeautiful(e)
    if (e.index == tes3.activeBodyPart.hair) then
        -- Returning false from this event will
        -- block the assignment of the body part.
        return false
    end
end
event.register(tes3.event.bodyPartAssigned, baldIsBeautiful)

bodyPartAssignedbodyPartsUpdated