tModLoader v2026.02
A mod to make and play Terraria mods
ILoadable Interface Referenceabstract

Works with Mod.AddContent to provide Load and Unload callbacks.
All non-abstract types extending this class which have a default constructor will be autoloaded and passed to Mod.AddContent
For autoloading types which do not have a default constructor, see ICustomAutoload More...

Inherits IAutoload< ILoadable.AutoloadImpl >.

Inherited by ModType< Achievement, ModAchievement >, ModType< EmoteBubble, ModEmoteBubble >, ModType< Item, ModItem >, ModType< Mount.MountData, ModMount >, ModType< NPC, ModNPC >, ModType< Player, ModPlayer >, ModType< Projectile, ModProjectile >, ModType< TEntity >, AShoppingBiome, IPlant, ModTileEntity, and ModType< TEntity, TModType >.

Classes

class  AutoloadImpl
 

Public Member Functions

virtual bool IsLoadingEnabled (Mod mod)
 Whether or not this type should be loaded when it's told to. Returning false disables Mod.AddContent from actually loading this type. More...
 
abstract void Load (Mod mod)
 Called when loading the type. More...
 
abstract void Unload ()
 Called during unloading when needed. More...
 

Detailed Description

Works with Mod.AddContent to provide Load and Unload callbacks.
All non-abstract types extending this class which have a default constructor will be autoloaded and passed to Mod.AddContent
For autoloading types which do not have a default constructor, see ICustomAutoload

Member Function Documentation

◆ IsLoadingEnabled()

virtual bool ILoadable.IsLoadingEnabled ( Mod  mod)
virtual

Whether or not this type should be loaded when it's told to. Returning false disables Mod.AddContent from actually loading this type.

Parameters
modThe mod instance trying to add this content

Implemented in ModTileEntity, ModType< TEntity, TModType >, ModType< Achievement, ModAchievement >, ModType< EmoteBubble, ModEmoteBubble >, ModType< Item, ModItem >, ModType< Mount.MountData, ModMount >, ModType< NPC, ModNPC >, ModType< Player, ModPlayer >, ModType< Projectile, ModProjectile >, and ModType< TEntity >.

◆ Load()

abstract void ILoadable.Load ( Mod  mod)
pure virtual

Called when loading the type.

Parameters
modThe mod instance associated with this type.

Implemented in IPlant, and ModTileEntity.

◆ Unload()