tModLoader v2024.10
A mod to make and play Terraria mods
NPCUtils Class Reference

Classes

class  SearchFilters
 
struct  TargetSearchResults
 

Public Types

enum  TargetSearchFlag { None = 0 , NPCs = 1 , Players = 2 , All = 3 }
 
enum  TargetType { None , NPC , Player , TankPet }
 

Public Member Functions

delegate void NPCTargetingMethod (NPC searcher, bool faceTarget, Vector2? checkPosition)
 
delegate bool SearchFilter< T > (T entity)
 

Static Public Member Functions

static TargetSearchResults SearchForTarget (NPC searcher, TargetSearchFlag flags=TargetSearchFlag.All, SearchFilter< Player > playerFilter=null, SearchFilter< NPC > npcFilter=null)
 
static TargetSearchResults SearchForTarget (NPC searcher, Vector2 position, TargetSearchFlag flags=TargetSearchFlag.All, SearchFilter< Player > playerFilter=null, SearchFilter< NPC > npcFilter=null)
 
static TargetSearchResults SearchForTarget (Vector2 position, TargetSearchFlag flags=TargetSearchFlag.All, SearchFilter< Player > playerFilter=null, SearchFilter< NPC > npcFilter=null)
 
static void TargetClosestBetsy (NPC searcher, bool faceTarget=true, Vector2? checkPosition=null)
 
static void TargetClosestCommon (NPC searcher, bool faceTarget=true, Vector2? checkPosition=null)
 
static void TargetClosestDownwindFromNPC (NPC searcher, float distanceMaxX, bool faceTarget=true, Vector2? checkPosition=null)
 
static void TargetClosestNonBees (NPC searcher, bool faceTarget=true, Vector2? checkPosition=null)
 
static void TargetClosestOldOnesInvasion (NPC searcher, bool faceTarget=true, Vector2? checkPosition=null)
 

Member Function Documentation

◆ SearchFilter< T >()

delegate bool NPCUtils.SearchFilter< T > ( entity)
Type Constraints
T :Entity