TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ CanChat()

virtual bool Terraria.ModLoader.ModNPC.CanChat ( )
inlinevirtual

Allows you to determine whether this NPC can talk with the player. By default, returns if the NPC is a town NPC.

This hook is not based on the type of the NPC, and is queried specifically on the ModNPC itself, regardless of if, for example, the type of the NPC instance is changed. Returning true in all circumstances will always make the NPC able to be chatted with no matter what else you do the NPC instance itself.

Returns

Definition at line 700 of file ModNPC.cs.

701 {
702 return NPC.townNPC;
703 }
NPC NPC
The NPC object that this ModNPC controls.
Definition ModNPC.cs:23
bool townNPC
Definition NPC.cs:1174

References Terraria.NPC.townNPC.