NPCs

NPCs are friendly automated Non-Player Characters that provide services to players.

Players can utilize NPCs by standing near them and using the button on them. Most NPCs are vendors, selling items to players in exchange for coins, and can be sold items by a player to obtain coins. Some NPCs also perform other functions.

Most NPCs are "Town" NPCs, appearing after various milestones are achieved in game advancement (details below). They move into structures the player must generally build, known as houses, which are generally required for Town NPCs to remain available. Each NPC will need its own house.

Town NPCs that have moved into houses reduce enemy spawn rates in the area, an effect that increases the more of them are present. With three or more Town NPCs nearby, enemies generally stop spawning on or near the visible screen altogether. (Though not in Expert Mode.) Players tend to utilize this effect by building large structures ("Towns" or "Bases") with several integrated houses, to serve as their safe haven. These reductions are usually overridden by events like Blood Moons or Goblin Invasions, during which spawn rates return to normal or are elevated, and enemies will once again attack players and NPCs in the area.

Town NPCs generally walk around during the day. They remain still in their assigned houses at night. NPCs have limited health and can take damage, and ultimately die from enemies, traps, lava, or by drowning in water ; though they cannot be attacked directly by players (outside of special Voodoo Doll accessories or Rotten Eggs). They do not suffer from fall damage and their health regenerates over time. Town NPCs gain defense and damage boosts based on which bosses have been defeated in the current world.

If an NPC is killed, they will respawn after a delay, as long as a suitable vacant house is still available. If it has an inventory requirement to spawn (Merchant, Demolitionist, Arms Dealer, Dye Trader) they need to have the requirement met again to respawn.

Occasionally, NPCs sit in chairs. They also randomly "talk" to each other or the player (shown as mouth movement and speech bubbles). Most NPCs also have an attack method, which they will use to defend themselves against enemies in the vicinity.

There are currently 25 / 23  / 22  / 21  / 19  Town NPCs, 7  / 6  of whom normally appear in Hardmode. An additional 3 / 2  / 1  NPCs can be encountered that do not move into houses.

Housing
Each Town NPC requires a suitable, vacant house. A house is a room of a certain size enclosed by a frame of blocks, with user-placed background walls, along with a valid light source, flat surface item, and comfort item (see House for full details). Two NPCs can't live in the same house at the same time. Houses must not be located near Corruption or Crimson, and if those biomes spread too close to an occupied house, the NPC living there may move out from that house.

Town NPC home assignments can be rearranged using NPC flags from the Housing menu, where players can also check whether a room is a suitable house.

If a house occupied by an NPC is damaged in a way that makes it invalid, the NPC will move out and walk around the area until a suitable house is restored. If there are vacant houses available in the world, the NPC may move into one of them. If the NPC gets killed and doesn't have a home, it will not respawn till a house is built.

The Guide and Old Man are unique in that they always spawn upon creating a world. The Guide will usually move into the first house built. The Old Man does not move into a house, but rather remains near the Dungeon's entrance, and respawns the following day if killed (while Skeletron has not yet been defeated).

Buying and selling
Items can be bought simply by pressing the button on an NPC and taking items from its inventory while their cost in coins is available in the player's inventory ( or in the combined player's savings). Holding the button on stackable items allows the player to buy the item in bulk. The buy speed increases the longer the button is held.

Some NPCs sell biome-specific items when they are spoken to in certain biomes. They can be transported there by housing them there and waiting for the night (they will be teleported to their house at night once off-screen) or by using a King or Queen Statue. Note that the NPC does not need to live in the biome; talking to it while the player is in the biome is sufficient.

All NPC vendors can also be used to sell unwanted or surplus items to gain coins. The unwanted item(s) must be in the player's inventory. Hovering over the item while the NPC's inventory screen is open will display its sell value. Items are always sold to vendors at one-fifth of their purchase price. Not all items have a sell value (very common items such as Dirt or Wood have no value). To sell the item, move it into the NPC's inventory.

Sales to ( and purchases from) NPCs can be cancelled while the NPC's inventory screen is still open: Sold items can be taken back in exchange for the amount they were sold for (and on, purchased items can be sold back in exchange for the amount they were purchased for).

All NPC vendors have the same base buying and selling price. Item prices can be decreased by equipping a Discount Card, which is a rare drop from Pirate Invasions. On, prices can also be higher or lower based on the NPC's happiness level.

All NPC vendors will sell when their happiness level  is above a certain threshold.

Town NPCs
Listed in the order in which they are generally likely to be acquired.

Town pets
Town pets are special NPCs that appear when a pet license item sold by the Zoologist is used. They are not to be confused with pets, which follow the player around. Town pets have distinctive housing assignment banners, and can share Houses with another NPC. They count as NPCs for Pylon requirements and for decreasing enemy spawn rates in an area. They additionally raise the happiness level universally of all nearby NPCs.

Other NPCs
The following NPCs are not considered town NPCs because they do not move into houses.

Stat Boosts
All NPCs have a base defense stat of 15 (except for the Skeleton Merchant, who has 30), and their base attack stats vary from one NPC to another. In addition, on the, all NPCs gain specific defense and damage boosts based on the bosses that have been defeated so far in the current world. These boosts are completely independent of each other (e.g. the "Hardmode entered" boost can potentially be gained without first attaining the "Eye of Cthulhu beaten" boost, and vice-versa). The boosts are also permanent for a given world, and are applied instantly to all Town NPCs, including all Town pets and all Other NPCs.

On the, the Dryad gains boosts to her attack damage. She does not deal damage directly, but rather by inflicting the debuff on enemies; thus, the damage dealt by the debuff is enhanced in a similar way to how other NPCs' damage stats are boosted on. These boosts to the Dryad's Bane debuff are not quite the same as those damage-stat boosts, however, so both kinds of boosts are listed in the following table. Just as with the -only stat boosts, the Dryad's Bane boosts are independent of each other, are permanent for a given world, and are applied instantly to all enemies inflicted with the debuff.

Happiness
Since the 1.4 update, NPCs now have individual preferences about other NPCs or the biome they live in which in turn affects their prices. When selecting Happiness in an NPC tooltip, the NPC will tell the player if any factors make it currently happy or unhappy, although it will not say what could make it happier or unhappier. For example, if the Guide is located alone in a Forest, he will praise the lack of other NPCs around and the fact he is in a Forest, but he will not hint at the fact he would prefer to live near the Clothier or Zoologist.

Factors that make an NPC happy will lower its prices for goods purchased from it, down to a minimum of 75%, and increase the value of goods sold to it by the inverse of the same modifier, up to a maximum of 133% (1/0.75). Conversely, factors that make an NPC unhappy will raise its prices purchased from it, up to a maximum of 150%, and decrease the value of goods sold to it, down to a minimum 67% (2/3). Price modifiers are rounded to the nearest 5% increment. When an NPC that sells items, other than the Skeleton Merchant or Traveling Merchant, has a price modifier at or below 85%, they will allow the player to purchase the Pylon for their current biome. The Tax Collector's current tax funds and tax collection limit are both divided by his happiness factor, such that at maximum happiness he will store up to, and at maximum unhappiness he will only store up to ; the amount of taxes that he collects per minute also scales at the same rate.

Note that for the purpose of calculating distances below, the position of an NPC's home tile is considered instead of the NPC itself, unless the NPC is homeless in which case its actual position is considered. Similarly, biome-related preferences will reference the primary biome where the player is, rather than where the NPC or its home is. Hybrid biomes are not considered, meaning that biomes are evaluated according to priority, with the highest-priority biome the player is in being chosen as the current biome. The list of biomes, in order of greatest to least priority, is as follows:


 * (1) Dungeon → (2) Corruption → (3) Crimson → (4) Glowing Mushroom → (5) Hallow → (6) Jungle → (7) Snow → (8) Ocean → (9) Desert → (10) Underground → (11) Forest

Factors affecting Happiness
The below price modifiers are multiplicative, but because of the rounding to 5% increments you can often treat them as additive. Additionally, the price multiplier will always be set to the maximum 150% if the NPC is homeless, more than 120 tiles from their house, or located in the Corruption, Crimson, or Dungeon.

Emotes
Although it may seem to be random, NPCs "emote" about things depending on their environment.

Tips

 * Each time the Traveling Merchant spawns, he will have a random shop inventory. If the player leaves the world between 4:30AM and 12:00AM, and enters again, there is a 22% chance he will re-spawn (with a new shop inventory).
 * Bound NPCs found underground can be freed by talking to them, after which they will always respawn whenever a vacant house is available. Having an empty room ready for them beforehand will cause them to move in at night as soon as they are off-screen.
 * Bound NPCs can be found by listening to their "hurt" sounds, especially the Mechanic, as the Dungeon is teeming with enemies.
 * A housing area can be created where all the NPCs can have their biome-specific items: 300 Pink Ice Block, 100 Mushroom grass, and 80 Lihzahrd Brick in one screen where the houses are located.
 * Drowning an NPC in water is an easy way to get NPC drops (safer than lava and quicker than Rotten Eggs).
 * A vendor NPC alone in a preferred biome is sufficiently happy enough to sell a Pylon. For this reason, it is possible when starting a town in another biome to move that NPC there before any others, buy the pylon when they respawn, then move them back to their original housing if so desired. Note that to use a pylon there must be at least two nearby NPCs, but none of them have to be the same NPC the pylon was purchased from, nor do any have to be happy.
 * You can use the Advanced Combat Techniques book, obtained by fishing during a Blood Moon to permanently increase the stats of all NPCs.
 * To open a chest behind an NPC, right click twice. The first click will open the NPC's dialogue box. The second click will open the chest.

Trivia

 * During a Blood Moon, all female NPCs except the Party Girl use more irritable or aggressive dialogue than normal.