tModLoader v2024.03
A mod to make and play Terraria mods
EntitySource_ItemUse_OnHurt Class Reference

Combination of IEntitySource_OnHurt and IEntitySource_WithStatsFromItem

More...

Inherits EntitySource_ItemUse, and IEntitySource_OnHurt.

Public Member Functions

 EntitySource_ItemUse_OnHurt (Player player, Item item, Entity? attacker, string? context=null)
 
- Public Member Functions inherited from EntitySource_ItemUse
 EntitySource_ItemUse (Player player, Item item, string? context=null)
 
- Public Member Functions inherited from EntitySource_Parent
 EntitySource_Parent (Entity entity, string? context=null)
 

Properties

EntityAttacker [get]
 The attacking entity. Note that this may be a Projectile (possibly owned by a player), a Player or even a NPC More...
 
Entity Victim [get]
 The entity being attacked. Normally a Player, but could be an NPC if a mod decides to use this source in such a way More...
 
- Properties inherited from EntitySource_ItemUse
Item Item [get]
 The item being used More...
 
Player Player [get]
 The Player using the Item. Equal to EntitySource_Parent.Entity More...
 
- Properties inherited from EntitySource_Parent
string? Context [get]
 Additional context identifier, particularly useful for set bonuses or accessory affects. See ItemSourceID and ProjectileSourceID for vanilla uses More...
 
Entity Entity [get]
 The entity which is the source of the effect or action. In many cases, it makes sense to consider buffs or effects applied to the parent entity, and make changes to the spawned entity.
 
- Properties inherited from IEntitySource
string? Context [get]
 Additional context identifier, particularly useful for set bonuses or accessory affects. See ItemSourceID and ProjectileSourceID for vanilla uses More...
 
- Properties inherited from IEntitySource_WithStatsFromItem
Item Item [get]
 The item being used More...
 
Player Player [get]
 The Player using the Item. Equal to EntitySource_Parent.Entity More...
 
- Properties inherited from IEntitySource_OnHurt
EntityAttacker [get]
 The attacking entity. Note that this may be a Projectile (possibly owned by a player), a Player or even a NPC More...
 
Entity Victim [get]
 The entity being attacked. Normally a Player, but could be an NPC if a mod decides to use this source in such a way More...
 

Detailed Description

Combination of IEntitySource_OnHurt and IEntitySource_WithStatsFromItem

Used for on-hurt accessories in vanilla (Star Cloak, Brain of Confusion etc).
Modders should be aware that it is not necessary to use this instead of EntitySource_OnHurt
The combination with IEntitySource_WithStatsFromItem will only have an effect if the item has damage/crit/armor pen stats which vanilla accessories do not
Some mods may wish to transfer other accessory bonuses from the item to spawned projectiles.

Property Documentation

◆ Attacker

Entity? EntitySource_ItemUse_OnHurt.Attacker
get

The attacking entity. Note that this may be a Projectile (possibly owned by a player), a Player or even a NPC

Implements IEntitySource_OnHurt.

◆ Victim

Entity EntitySource_ItemUse_OnHurt.Victim
get

The entity being attacked. Normally a Player, but could be an NPC if a mod decides to use this source in such a way

Implements IEntitySource_OnHurt.