tModLoader v2024.11
A mod to make and play Terraria mods
Player.HurtInfo Struct Reference

Public Attributes

bool Cancelled = false
 
int CooldownCounter = -1
 
PlayerDeathReason DamageSource = null
 
bool Dodgeable = true
 
bool DustDisabled = false
 If true, dust will not spawn
 
int HitDirection = 0
 
float Knockback = 0
 The amount of knockback to apply. Should always be >= 0.
 
bool PvP = false
 
bool SoundDisabled = false
 If true, sound will not play
 

Properties

int Damage [get, set]
 The amount of damage received by the player. How much life the player will lose.
Is NOT capped at the player's current life.
Cannot be set to less than 1.
 
int SourceDamage [get, set]
 The amount of damage 'dealt' to the player, before incoming damage multipliers, armor, damage reduction.
Use this to trigger effects which scale based on how 'hard' the player was hit rather than how much life was lost.
Cannot be set to less than 1.

Using this instead of Damage can prevent diminishing returns damage mitigation, when adding beneficial effects like retaliatory damage.