Skip to content

Unit Selection Type

Core Helper

Returns ElvUI’s normalized unit selection type, with optional hostile-threat handling.

NamespaceEModuleCoreLifecyclestable
E:UnitSelectionType(unit, considerHostile)

Returns ElvUI’s normalized unit selection type, with optional hostile-threat handling.

unit: Unit token to inspect. considerHostile: Treat units with player threat as hostile.

Numeric selection type, or nil when the client cannot resolve one.

local selectionType = E:UnitSelectionType("target", true)

Useful when addon coloring should match ElvUI nameplate or unit selection behavior.

Source: ElvUI/Game/Shared/General/API.lua:212