tModLoader  0.12 Alpha
A mod to make and play Terraria mods
Terraria.ModLoader.ModType Class Referenceabstract

The base type for most modded things. More...

Inherits Terraria.ModLoader.IModType.

Inherited by Terraria.ModLoader.GlobalType< Projectile >, Terraria.ModLoader.GlobalType< Item >, Terraria.ModLoader.GlobalType< NPC >, Terraria.ModLoader.IO.TagSerializer< Point16, TagCompound >, Terraria.ModLoader.IO.TagSerializer< Vector2, TagCompound >, Terraria.ModLoader.IO.TagSerializer< Vector3, TagCompound >, Terraria.ModLoader.IO.TagSerializer< ushort, short >, Terraria.ModLoader.IO.TagSerializer< uint, int >, Terraria.ModLoader.IO.TagSerializer< T, TagCompound >, Terraria.ModLoader.IO.TagSerializer< Rectangle, TagCompound >, Terraria.ModLoader.IO.TagSerializer< Color, int >, Terraria.ModLoader.IO.TagSerializer< ulong, long >, Terraria.ModLoader.IO.TagSerializer< bool, byte >, Terraria.ModLoader.DamageClass, Terraria.ModLoader.GlobalBackgroundStyle, Terraria.ModLoader.GlobalBlockType, Terraria.ModLoader.GlobalBossBar, Terraria.ModLoader.GlobalBuff, Terraria.ModLoader.GlobalInfoDisplay, Terraria.ModLoader.GlobalRecipe, Terraria.ModLoader.GlobalType< TEntity >, Terraria.ModLoader.IO.TagSerializer< T, S >, Terraria.ModLoader.ModBackgroundStyle, Terraria.ModLoader.ModBossBarStyle, Terraria.ModLoader.ModCommand, Terraria.ModLoader.ModMenu, Terraria.ModLoader.ModPlayer, Terraria.ModLoader.ModPrefix, Terraria.ModLoader.ModRarity, Terraria.ModLoader.ModSceneEffect, Terraria.ModLoader.ModSystem, Terraria.ModLoader.ModTexturedType, and Terraria.ModLoader.PlayerDrawLayer.

Public Member Functions

virtual bool IsLoadingEnabled (Mod mod)
 Allows you to stop Mod.AddContent from actually adding this content. Useful for items that can be disabled by a config. More...
 
virtual void Load ()
 Allows you to perform one-time loading tasks. Beware that mod content has not finished loading here, things like ModContent lookup tables or ID Sets are not fully populated. More...
 
virtual void SetStaticDefaults ()
 Allows you to modify the properties after initial loading has completed. More...
 
virtual void SetupContent ()
 If you make a new ModType, seal this override, and call SetStaticDefaults in it. More...
 
virtual void Unload ()
 Allows you to safely unload things you added in Load. More...
 

Protected Member Functions

abstract void Register ()
 If you make a new ModType, seal this override. More...
 

Properties

string FullName [get]
 The internal name of this, including the mod it is from. More...
 
Mod Mod [get, set]
 The mod this belongs to. More...
 
virtual string Name [get]
 The internal name of this. More...
 
- Properties inherited from Terraria.ModLoader.IModType
string FullName [get]
 => $"{Mod.Name}/{Name}" More...
 
Mod Mod [get]
 The mod this belongs to. More...
 
string Name [get]
 The internal name of this instance. More...
 

Detailed Description

The base type for most modded things.

Member Function Documentation

◆ IsLoadingEnabled()

virtual bool Terraria.ModLoader.ModType.IsLoadingEnabled ( Mod  mod)
virtual

Allows you to stop Mod.AddContent from actually adding this content. Useful for items that can be disabled by a config.

Parameters
modThe mod adding this content

Implements Terraria.ModLoader.ILoadable.

◆ Load()

virtual void Terraria.ModLoader.ModType.Load ( )
virtual

Allows you to perform one-time loading tasks. Beware that mod content has not finished loading here, things like ModContent lookup tables or ID Sets are not fully populated.

Use SetStaticDefaults when you need to access content.

◆ Register()

abstract void Terraria.ModLoader.ModType.Register ( )
protectedpure virtual

If you make a new ModType, seal this override.

Implemented in Terraria.ModLoader.PlayerDrawLayer, Terraria.ModLoader.ModWaterfallStyle, Terraria.ModLoader.ModWaterStyle, Terraria.ModLoader.ModWall, Terraria.ModLoader.ModTile, Terraria.ModLoader.ModSystem, Terraria.ModLoader.ModSceneEffect, Terraria.ModLoader.ModRarity, Terraria.ModLoader.ModProjectile, Terraria.ModLoader.ModPrefix, Terraria.ModLoader.ModPlayer, Terraria.ModLoader.ModNPC, Terraria.ModLoader.ModMount, Terraria.ModLoader.ModMenu, Terraria.ModLoader.ModItem, Terraria.ModLoader.ModGore, Terraria.ModLoader.ModDust, Terraria.ModLoader.ModCommand, Terraria.ModLoader.ModBuff, Terraria.ModLoader.ModBossBarStyle, Terraria.ModLoader.ModBossBar, Terraria.ModLoader.ModBiome, Terraria.ModLoader.GlobalBackgroundStyle, Terraria.ModLoader.ModSurfaceBackgroundStyle, Terraria.ModLoader.ModUndergroundBackgroundStyle, Terraria.ModLoader.IO.TagSerializer< T, S >, Terraria.ModLoader.IO.TagSerializer< Point16, TagCompound >, Terraria.ModLoader.IO.TagSerializer< Vector2, TagCompound >, Terraria.ModLoader.IO.TagSerializer< Vector3, TagCompound >, Terraria.ModLoader.IO.TagSerializer< ushort, short >, Terraria.ModLoader.IO.TagSerializer< uint, int >, Terraria.ModLoader.IO.TagSerializer< T, TagCompound >, Terraria.ModLoader.IO.TagSerializer< Rectangle, TagCompound >, Terraria.ModLoader.IO.TagSerializer< Color, int >, Terraria.ModLoader.IO.TagSerializer< ulong, long >, Terraria.ModLoader.IO.TagSerializer< bool, byte >, Terraria.ModLoader.InfoDisplay, Terraria.ModLoader.GlobalWall, Terraria.ModLoader.GlobalTile, Terraria.ModLoader.GlobalRecipe, Terraria.ModLoader.GlobalProjectile, Terraria.ModLoader.GlobalNPC, Terraria.ModLoader.GlobalItem, Terraria.ModLoader.GlobalInfoDisplay, Terraria.ModLoader.GlobalBuff, Terraria.ModLoader.GlobalBossBar, and Terraria.ModLoader.DamageClass.

◆ SetStaticDefaults()

◆ SetupContent()

virtual void Terraria.ModLoader.ModType.SetupContent ( )
virtual

If you make a new ModType, seal this override, and call SetStaticDefaults in it.

Reimplemented in Terraria.ModLoader.PlayerDrawLayer, Terraria.ModLoader.ModWaterfallStyle, Terraria.ModLoader.ModWaterStyle, Terraria.ModLoader.ModWall, Terraria.ModLoader.ModTile, Terraria.ModLoader.ModSystem, Terraria.ModLoader.ModRarity, Terraria.ModLoader.ModProjectile, Terraria.ModLoader.ModPrefix, Terraria.ModLoader.ModPlayer, Terraria.ModLoader.ModNPC, Terraria.ModLoader.ModMount, Terraria.ModLoader.ModMenu, Terraria.ModLoader.ModItem, Terraria.ModLoader.ModGore, Terraria.ModLoader.ModDust, Terraria.ModLoader.ModCommand, Terraria.ModLoader.ModBuff, Terraria.ModLoader.ModBossBarStyle, Terraria.ModLoader.ModBossBar, Terraria.ModLoader.ModBiome, Terraria.ModLoader.GlobalBackgroundStyle, Terraria.ModLoader.ModSurfaceBackgroundStyle, Terraria.ModLoader.ModUndergroundBackgroundStyle, Terraria.ModLoader.IO.TagSerializer< T, S >, Terraria.ModLoader.IO.TagSerializer< Point16, TagCompound >, Terraria.ModLoader.IO.TagSerializer< Vector2, TagCompound >, Terraria.ModLoader.IO.TagSerializer< Vector3, TagCompound >, Terraria.ModLoader.IO.TagSerializer< ushort, short >, Terraria.ModLoader.IO.TagSerializer< uint, int >, Terraria.ModLoader.IO.TagSerializer< T, TagCompound >, Terraria.ModLoader.IO.TagSerializer< Rectangle, TagCompound >, Terraria.ModLoader.IO.TagSerializer< Color, int >, Terraria.ModLoader.IO.TagSerializer< ulong, long >, Terraria.ModLoader.IO.TagSerializer< bool, byte >, Terraria.ModLoader.InfoDisplay, Terraria.ModLoader.GlobalWall, Terraria.ModLoader.GlobalTile, Terraria.ModLoader.GlobalRecipe, Terraria.ModLoader.GlobalProjectile, Terraria.ModLoader.GlobalNPC, Terraria.ModLoader.GlobalItem, Terraria.ModLoader.GlobalInfoDisplay, Terraria.ModLoader.GlobalBuff, Terraria.ModLoader.GlobalBossBar, and Terraria.ModLoader.DamageClass.

◆ Unload()

virtual void Terraria.ModLoader.ModType.Unload ( )
virtual

Allows you to safely unload things you added in Load.

Implements Terraria.ModLoader.ILoadable.

Property Documentation

◆ FullName

string Terraria.ModLoader.ModType.FullName
get

The internal name of this, including the mod it is from.

◆ Mod

Mod Terraria.ModLoader.ModType.Mod
getset

The mod this belongs to.

◆ Name

virtual string Terraria.ModLoader.ModType.Name
get

The internal name of this.