PlayerLocationMixin

From Warcraft Wiki
Jump to navigation Jump to search

A PlayerLocation object refers to a player, for example by their unit id, chat line message or guid.

Source: FrameXML\ObjectAPI\PlayerLocation.lua

API

Methods

Example

Prints the race and class of your character.

local playerLoc = PlayerLocation:CreateFromUnit("player")

local raceId = C_PlayerInfo.GetRace(playerLoc)
local raceName = C_CreatureInfo.GetRaceInfo(raceId).raceName
local class = C_PlayerInfo.GetClass(playerLoc)
print(raceName, class) -- "Dwarf", "Priest"

The minimal representation is a table with e.g. the unit, chatLineID or guid field.

/dump C_PlayerInfo.GetClass({unit = "player"})

Used by

Note
Note: This list is up to date as of Patch 10.0.2 (46879) Nov 29 2022
Function arguments
C_PlayerInfo.GetClass
C_PlayerInfo.GetName
C_PlayerInfo.GetRace
C_PlayerInfo.GetSex
C_PlayerInfo.IsConnected
C_PlayerInfo.UnitIsSameServer
C_PlayerMentorship.GetMentorshipStatus
C_ReportSystem.CanReportPlayer
C_ReportSystem.CanReportPlayerForLanguage
C_ReportSystem.SendReport
C_VoiceChat.GetMemberVolume
C_VoiceChat.IsMemberMuted
C_VoiceChat.IsPlayerUsingVoice
C_VoiceChat.SetMemberMuted
C_VoiceChat.SetMemberVolume
C_VoiceChat.ToggleMemberMuted

Patch changes

Battle for Azeroth Patch 8.0.1 (2018-07-17): Added.

External links

 GitHub Octocat.png Search FrameXML