tModLoader v2023.01
A mod to make and play Terraria mods
Terraria.Entity Class Reference

Inherited by Terraria.Item, Terraria.NPC, Terraria.Player, and Terraria.Projectile.

Public Member Functions

float AngleFrom (Vector2 Source)
 
float AngleTo (Vector2 Destination)
 
Vector2 DirectionFrom (Vector2 Source)
 
Vector2 DirectionTo (Vector2 Destination)
 
float Distance (Vector2 Other)
 
float DistanceSQ (Vector2 Other)
 
IEntitySource GetSource_Accessory (Item item, string? context=null)
 
IEntitySource GetSource_CatchEntity (Entity caughtEntity, string? context=null)
 
IEntitySource GetSource_Death (string? context=null)
 
IEntitySource GetSource_DropAsItem (string? context=null)
 
IEntitySource GetSource_FromAI (string? context=null)
 
IEntitySource GetSource_FromThis (string? context=null)
 
IEntitySource GetSource_GiftOrReward (string? context=null)
 
IEntitySource GetSource_ItemUse (Item item, string? context=null)
 
IEntitySource GetSource_ItemUse_WithPotentialAmmo (Item item, int ammoItemId, string? context=null)
 
IEntitySource GetSource_Loot (string? context=null)
 
IEntitySource GetSource_Misc (string context)
 
IEntitySource GetSource_OnHit (Entity victim, string? context=null)
 
IEntitySource GetSource_OnHurt (Entity attacker, string? context=null)
 
IEntitySource GetSource_OpenItem (int itemType, string? context=null)
 
IEntitySource GetSource_ReleaseEntity (string? context=null)
 
IEntitySource GetSource_TileInteraction (int tileCoordsX, int tileCoordsY, string? context=null)
 
bool WithinRange (Vector2 Target, float MaxRange)
 

Static Public Member Functions

static IEntitySource GetSource_NaturalSpawn ()
 
static ? IEntitySource GetSource_None ()
 
static IEntitySource GetSource_TownSpawn ()
 
static ? IEntitySource InheritSource (Entity entity)
 

Public Attributes

bool active
 
int direction = 1
 
int height
 
bool honeyWet
 
bool lavaWet
 
int oldDirection
 
Vector2 oldPosition
 
Vector2 oldVelocity
 
Vector2 position
 
Vector2 velocity
 
bool wet
 
byte wetCount
 
int whoAmI
 
int width
 

Properties

Vector2 Bottom [get, set]
 
Vector2 BottomLeft [get, set]
 
Vector2 BottomRight [get, set]
 
Vector2 Center [get, set]
 
Rectangle Hitbox [get, set]
 
Vector2 Left [get, set]
 
Vector2 Right [get, set]
 
Vector2 Size [get, set]
 
Vector2 Top [get, set]
 
Vector2 TopLeft [get, set]
 
Vector2 TopRight [get, set]
 
virtual Vector2 VisualPosition [get]