The /target command changes or assigns your target in a macro. You may have used the /target command on its own in the game world, to try to locate a nearby player or NPC by name - such as "/target Hogger." You can also use this command and variants of it in macros, particularly in conjunction with other macro commands such as "/cast." We'll go into more depth on targeting in macros in the next part of this guide, but for now here are some basic guidelines and examples:

Using "/target" followed by a name will find the nearest player, monster, or NPC that has a name matching the one you entered as long as that entity is within a certain proximity to you. However, searching by name doesn't distinguish between players or computer-controlled entities, nor does it distinguish between the living and the dead. In addition, if there isn't an exact match for the name nearby, you may end up targeting an entity with a similar name instead.

Instead of targeting an entity by name, you can target your target's unit ID. Here is a current partial list of unit IDs:

player = the current player

pet = the current player's pet

party# = the party member with the value's position in the group configuration (excluding the player himself), where # is 1, 2, 3 or 4

partypet# = the pet of the party member with the value's position in the group configuration, where # is 1, 2, 3 or 4

raid# = the raid member with the value's position in the raid, where # is a value from 1 through 40. The # has no relation to which group a given member is in. In addition, raid1 is always the raid leader, and the last number in a raid is always the player himself. Thus, in a 25-person raid, raid25 would be the player's ID.

raidpet# = the pet of the raid member with the value's position in the raid, where # is a value from 1 through 40

mouseover = the unit over which the mouse is currently hovering. This unit ID is of particular use in healing macros, so that you can quickly heal someone with a mouseover without deselecting your current target (usually the main tank).

If you add "target" at the end of any of these unit IDs, you will reference that entity's target: for instance, "playertarget."

The commonly used /assist macro may be among the first you ever make, usually on request from another player in a group situation. The simplest form is "/assist player name," although you can use any of the unit IDs seen above. This macro is often used to coordinate focus fire attacks and is extremely useful in both PvP and PvE.

The variable %t can be used in macros to indicate your current target. This variable is useful for social macros: it plugs your current target's name into whatever you're saying. You'll find an example of this in the next section.

The /targetlasttarget command switches your target to the player or monster you had targeted last. This can be quite useful in situations where you're quickly switching between two targets that are far apart, such as when healing another player before switching back to the main tank.

Some additional targeting commands duplicate default key bindings but can be useful in macros. These include /targetenemy, /targetfriend, /targetparty, and /targetraid. Similar to the default Tab and Ctrl-Tab key functions, these commands will cycle through the field of players or monsters encompassed by the command. To cycle in reverse (akin to Shift-Tab), just add a 1 after the command. The /targetparty command can be useful for casting buffs: for example, spamming the macro "/targetparty /cast Power Word: Fortitude" will cycle through a priest's party and cast that buff on each party member.