tModLoader v2024.11
A mod to make and play Terraria mods
EntitySource_ItemUse Class Reference

Use the interface, IEntitySource_WithStatsFromItem instead when checking entity sources in OnSpawn

More...

Inherits EntitySource_Parent, and IEntitySource_WithStatsFromItem.

Inherited by EntitySource_ItemUse_OnHurt, and EntitySource_ItemUse_WithAmmo.

Public Member Functions

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

Properties

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...
 

Detailed Description

Use the interface, IEntitySource_WithStatsFromItem instead when checking entity sources in OnSpawn

Used when a player uses an item or an accessory.

Property Documentation

◆ Item

Item EntitySource_ItemUse.Item
get

The item being used

Implements IEntitySource_WithStatsFromItem.

◆ Player

Player EntitySource_ItemUse.Player
get