tModLoader v2022.09
A mod to make and play Terraria mods
Terraria.ModLoader Namespace Reference

Classes

class  AccessorySlotLoader
 This serves as a central place to store equipment slots and their corresponding textures. You will use this to obtain the IDs for your equipment textures. More...
 
class  AutoloadAttribute
 Allows for types to be autoloaded and unloaded. True to always autoload, false to never autoload, null to use mod default. More...
 
class  AutoloadBossHead
 
class  AutoloadEquip
 
class  AutoloadHead
 
class  BackgroundTextureLoader
 This is the class that keeps track of all modded background textures and their slots/IDs. More...
 
class  BackupIO
 
class  BiomeLoader
 
class  BossBarLoader
 
class  BuffLoader
 This serves as the central class from which buff-related functions are supported and carried out. More...
 
class  BuildInfo
 
class  ChatCommandCaller
 
class  CloneByReference
 Indicates that references to this object can be shared between clones. When applied to a class, applies to all fields/properties of that type. More...
 
class  CombinedHooks
 
interface  CommandCaller
 
class  CommandLoader
 This serves as the central class from which ModCommand functions are supported and carried out. More...
 
class  CompassInfoDisplay
 
class  ConsoleCommandCaller
 
class  ContentInstance
 
class  DamageClass
 
class  DamageClassData
 
class  DamageClassLoader
 
class  DefaultDamageClass
 
class  DepthMeterInfoDisplay
 
class  DPSMeterInfoDisplay
 
class  DrawableTooltipLine
 This class serves as a way to store information about a line that will be drawn of tooltip for an item. You will create and manipulate objects of this class if you use the draw hooks for tooltips in ModItem and GlobalItem. For examples, see ExampleSword More...
 
class  DummyInfoDisplay
 
class  DustLoader
 
class  EquipLoader
 This serves as a central place to store equipment slots and their corresponding textures. You will use this to obtain the IDs for your equipment textures. More...
 
class  EquipTexture
 This serves as a place for you to program behaviors of equipment textures. This is useful for equipment slots that do not have any item associated with them (for example, the Werewolf buff). Note that this class is purely for visual effects. More...
 
class  ExtendsFromModAttribute
 
class  FishFinderInfoDisplay
 
class  FrameworkVersion
 
class  GameTipData
 Wrapper class for a LocalizedText and visibility field that has intended use with modification of Game Tips. More...
 
class  GameTipID
 This class contains a more human-readable name for every single Game Tip created by Vanilla. More...
 
class  GenericDamageClass
 
class  GlobalBackgroundStyle
 This class serves to collect functions that operate on any kind of background style, without being specific to one single background style. More...
 
class  GlobalBackgroundStyleLoader
 
class  GlobalBlockType
 This is the superclass for GlobalTile and GlobalWall, combining common code More...
 
class  GlobalBossBar
 A class that is used to modify existing boss health bars. To add them, use ModBossBar instead. More...
 
class  GlobalBuff
 This class allows you to modify the behavior of any buff in the game. More...
 
class  GlobalInfoDisplay
 A class that is used to modify existing info displays (i.e. the things that the Cell Phone uses to communicate information). All vanilla displays can be accessed using InfoDisplay.(name of item). More...
 
class  GlobalItem
 This class allows you to modify and use hooks for all items, including vanilla items. Create an instance of an overriding class then call Mod.AddGlobalItem to use this. More...
 
struct  GlobalLoot
 This readonly struct is a simple shortcut for modifying global drop rules in an ItemDropDatabase. More...
 
class  GlobalNPC
 This class allows you to modify and use hooks for all NPCs, including vanilla mobs. Create an instance of an overriding class then call Mod.AddGlobalNPC to use this. More...
 
class  GlobalProjectile
 This class allows you to modify and use hooks for all projectiles, including vanilla projectiles. Create an instance of an overriding class then call Mod.AddGlobalProjectile to use this. More...
 
class  GlobalPylon
 Global Type that exists for pylons that allows for modification of teleportation steps, map drawing, and other functionality for any pylon that exists, whether it be vanilla or modded. More...
 
class  GlobalRecipe
 
class  GlobalTile
 This class allows you to modify the behavior of any tile in the game. Create an instance of an overriding class then call Mod.AddGlobalTile to use this. More...
 
class  GlobalType
 
class  GlobalWall
 This class allows you to modify the behavior of any wall in the game (although admittedly walls don't have much behavior). Create an instance of an overriding class then call Mod.AddGlobalWall to use this. More...
 
class  GoreLoader
 
interface  IEntityWithGlobals
 
interface  IEntityWithInstances
 
interface  IIndexed
 
interface  ILoadable
 Allows for implementing types to be loaded and unloaded. More...
 
interface  ILoader
 
interface  ILoot
 
interface  IModType
 
class  InfoDisplay
 
class  InfoDisplayLoader
 
class  InitializationContext
 
struct  Instanced
 The purpose of this struct is to micro-optimize lookups of GlobalX indices by providing these associations without additional retrievals from the heap. More...
 
interface  IPlant
 
interface  IPylonTileEntity
 Allows Tile Entities that you want to be included in vanilla's pylon list to actually be added to the list when said TE is extended by this interface. What this means, in short, is that whenever all of the pylons are refreshed by vanilla, Tile Entities that extend this interface will get their own

See also
TeleportPylonInfo

instance and it will be included along-side all of vanilla's pylons and any other modded pylons. More...

 
class  ItemCreationContext
 
class  ItemLoader
 This serves as the central class from which item-related functions are carried out. It also stores a list of mod items by ID. More...
 
struct  ItemLoot
 This readonly struct is a simple shortcut to ItemDropDatabase's methods. More...
 
interface  ITree
 
class  JITWhenModsEnabledAttribute
 
class  KeybindLoader
 
class  LegacyNameAttribute
 
class  LifeformAnalyzerInfoDisplay
 
class  Loader
 Serves as a highest-level base for loaders. More...
 
class  LoaderManager
 
class  LocalizationLoader
 
class  Logging
 
class  MagicDamageClass
 
class  MagicSummonHybridDamageClass
 
struct  MapEntry
 
class  MapLegend
 
class  MapLoader
 
class  MeleeDamageClass
 
class  MeleeNoSpeedDamageClass
 
class  MemberJitAttribute
 
class  MenuLoader
 
class  MetalDetectorInfoDisplay
 
class  Mod
 Mod is an abstract class that you will override. It serves as a central place from which the mod's contents are stored. It provides methods for you to use or override. More...
 
class  ModAccessorySlot
 A ModAccessorySlot instance represents a net new accessory slot instance. You can store fields in the ModAccessorySlot class. More...
 
class  ModBackgroundStyle
 
class  ModBiome
 This class represents a biome added by a mod. It exists to centralize various biome related hooks, handling a lot of biome boilerplate. More...
 
class  ModBlockType
 This is the superclass for ModTile and ModWall, combining common code More...
 
class  ModBossBar
 A class that is used to create custom boss health bars for modded and vanilla NPCs. More...
 
class  ModBossBarStyle
 A class that is used to swap out the entire boss bar display system with your own implementation More...
 
class  ModBuff
 This class serves as a place for you to define a new buff and how that buff behaves. More...
 
class  ModCactus
 This class represents a type of modded cactus. This class encapsulates a function for retrieving the cactus's texture and an array for type of soil it grows on. More...
 
class  ModCommand
 This class represents a chat or console command. Use the CommandType to specify the scope of the command. More...
 
class  ModContent
 Manages content added by mods. Liasons between mod content and Terraria's arrays and oversees the Loader classes. More...
 
class  ModDust
 This class represents a type of dust that is added by a mod. Only one instance of this class will ever exist for each type of dust you add.
The Basic Dust Guideteaches the basics of making modded dust. More...
 
class  ModGore
 This class allows you to customize the behavior of a custom gore. More...
 
class  ModItem
 This class serves as a place for you to place all your properties and hooks for each item. Create instances of ModItem (preferably overriding this class) to pass as parameters to Mod.AddItem.
The Basic Item Guideteaches the basics of making a modded item. More...
 
class  ModKeybind
 Represents a loaded input binding. It is suggested to access the keybind status only in ModPlayer.ProcessTriggers. More...
 
class  ModLoader
 This serves as the central class which loads mods. It contains many static fields and methods related to mods and their contents. More...
 
class  ModMapLayer
 This class is used to facilitate easily drawing icons and other things over the map. Pylons and spawn/bed icons are examples of vanilla map layers. Use ModSystem.PreDrawMapIconOverlay(System.Collections.Generic.IReadOnlyList<IMapLayer>, MapOverlayDrawContext) to selectively hide vanilla layers if needed. More...
 
class  ModMenu
 A class that is used to customize aesthetic features of the main menu, such as the logo, background and music. More...
 
class  ModMount
 This class serves as a place for you to place all your properties and hooks for each mount. Create instances of ModMoundData (preferably overriding this class) to pass as parameters to Mod.AddMount. Only one instance of ModMount will exist for each mount, so storing player specific data on the ModMount is not good. Modders can use player.mount._mountSpecificData or a ModPlayer class to store player specific data relating to a mount. Use SetMount to assign these fields. More...
 
class  ModNet
 
class  ModNPC
 This class serves as a place for you to place all your properties and hooks for each NPC. Create instances of ModNPC (preferably overriding this class) to pass as parameters to Mod.AddNPC. More...
 
class  ModPacket
 This class inherits from BinaryWriter. This means that you can use all of its writing functions to send information between client and server. This class also comes with a Send method that's used to actually send everything you've written between client and server. More...
 
class  ModPalmTree
 This class represents a type of modded palm tree. The palm tree will share a tile ID with the vanilla palm trees (323), so that the trees can freely convert between each other if the sand below is converted. This class encapsulates several functions that distinguish each type of palm tree from each other. More...
 
class  ModPlayer
 A ModPlayer instance represents an extension of a Player instance. You can store fields in the ModPlayer classes, much like how the Player class abuses field usage, to keep track of mod-specific information on the player that a ModPlayer instance represents. It also contains hooks to insert your code into the Player class. More...
 
class  ModPrefix
 
class  ModProjectile
 This class serves as a place for you to place all your properties and hooks for each projectile. Create instances of ModProjectile (preferably overriding this class) to pass as parameters to Mod.AddProjectile.
The Basic Projectile Guideteaches the basics of making a modded projectile. More...
 
class  ModPylon
 Extension to

See also
ModTile

that streamlines the process of creating a modded Pylon. Has all of ModTile's hooks for customization, but additional hooks for Pylon functionality. More...

 
class  ModRarity
 
class  ModSceneEffect
 ModSceneEffect is an abstract class that your classes can derive from. It serves as a container for handling exclusive SceneEffect content such as backgrounds, music, and water styling. More...
 
class  ModSideExtensions
 
class  ModSurfaceBackgroundStyle
 Each background style determines in its own way how exactly the background is drawn. This class serves as a collection of functions for above-ground backgrounds. More...
 
class  ModSystem
 ModSystem is an abstract class that your classes can derive from. It contains general-use hooks, and, unlike Mod, can have unlimited amounts of types deriving from it. More...
 
class  ModTexturedType
 The base type for most modded things with textures. More...
 
class  ModTile
 This class represents a type of tile that can be added by a mod. Only one instance of this class will ever exist for each type of tile that is added. Any hooks that are called will be called by the instance corresponding to the tile type. This is to prevent the game from using a massive amount of memory storing tile instances.
The Basic Tile Guideteaches the basics of making a modded tile. More...
 
class  ModTileEntity
 Tile Entities are Entities tightly coupled with tiles, allowing the possibility of tiles to exhibit cool behavior. TileEntity.Update is called in SP and on Server, not on Clients. More...
 
class  ModTranslation
 
class  ModTree
 This class represents a type of modded tree. The tree will share a tile ID with the vanilla trees (5), so that the trees can freely convert between each other if the soil below is converted. This class encapsulates several functions that distinguish each type of tree from each other. More...
 
class  ModType
 The base type for most modded things. More...
 
class  ModTypeLookup
 
class  ModUndergroundBackgroundStyle
 Each background style determines in its own way how exactly the background is drawn. This class serves as a collection of functions for underground backgrounds. More...
 
class  ModWall
 This class represents a type of wall that can be added by a mod. Only one instance of this class will ever exist for each type of wall that is added. Any hooks that are called will be called by the instance corresponding to the wall type. More...
 
class  ModWaterfallStyle
 Represents a style of waterfalls that gets drawn. This is mostly used to determine the color of the waterfall. More...
 
class  ModWaterStyle
 Represents a style of water that gets drawn, based on factors such as the background. This is used to determine the color of the water, as well as other things as determined by the hooks below. More...
 
class  MonoModHooks
 
class  MountLoader
 This serves as the central place from which mounts are stored and mount-related functions are carried out. More...
 
class  MusicLoader
 
class  NoJITAttribute
 
struct  NPCHappiness
 This struct provides access to an NPC type's NPC & Biome relationships. More...
 
class  NPCHeadLoader
 This class serves as a central place from which NPC head slots are stored and NPC head textures are assigned. This can be used to obtain the corresponding slots to head textures. More...
 
class  NPCLoader
 This serves as the central class from which NPC-related functions are carried out. It also stores a list of mod NPCs by ID. More...
 
struct  NPCLoot
 This readonly struct is a simple shortcut to ItemDropDatabase's methods. More...
 
struct  NPCSpawnInfo
 A struct that stores information regarding where an NPC is naturally spawning and the player it is spawning around. This serves to reduce the parameter count for ModNPC.CanSpawn and GlobalNPC.EditSpawnPool. More...
 
class  PlantLoader
 
class  PlayerCommandCaller
 
class  PlayerDrawLayer
 This class represents a DrawLayer for the player, and uses PlayerDrawInfo as its InfoType. Drawing should be done by adding Terraria.DataStructures.DrawData objects to Main.playerDrawData. More...
 
class  PlayerDrawLayerLoader
 
class  PlayerDrawLayerSlot
 
class  PlayerLoader
 This is where all ModPlayer hooks are gathered and called. More...
 
class  PosData
 
class  PrefixLoader
 
class  PreJITFilter
 
class  ProjectileLoader
 This serves as the central class from which projectile-related functions are carried out. It also stores a list of mod projectiles by ID. More...
 
class  PylonLoader
 
class  RadarInfoDisplay
 
class  RangedDamageClass
 
class  RarityLoader
 
class  RecipeCreationContext
 
class  RecipeLoader
 This is where all Recipe and GlobalRecipe hooks are gathered and called. More...
 
struct  RefReadOnlyArray
 
class  SceneEffectLoader
 This serves as the central class from which SceneEffect functions are supported and carried out. More...
 
class  SextantInfoDisplay
 
class  SimpleModGore
 
struct  StatInheritanceData
 
struct  StatModifier
 
class  StopwatchInfoDisplay
 
class  SummonDamageClass
 
class  SummonMeleeSpeedDamageClass
 
class  SurfaceBackgroundStylesLoader
 
class  SystemLoader
 This is where all ModSystem hooks are gathered and called. More...
 
class  TallyCounterInfoDisplay
 
class  ThrowingDamageClass
 
class  TileLoader
 This serves as the central class from which tile-related functions are supported and carried out. More...
 
class  TooltipLine
 This class serves as a way to store information about a line of tooltip for an item. You will create and manipulate objects of this class if you use the ModifyTooltips hook. More...
 
class  TopoSort
 
class  UndergroundBackgroundStylesLoader
 This serves as the central class from which ModUndergroundBackgroundStyle functions are supported and carried out. More...
 
class  UsageException
 
class  VanillaDamageClass
 
class  VanillaInfoDisplay
 
class  WallLoader
 This serves as the central class from which wall-related functions are supported and carried out. More...
 
class  WatchesInfoDisplay
 
class  WaterFallStylesLoader
 
class  WaterStylesLoader
 
class  WeatherRadioInfoDisplay
 

Enumerations

enum  AccessorySlotType { FunctionalSlot = 10 , VanitySlot = 11 , DyeSlot = 12 }
 
enum  CommandType { Chat = 1 , Server = 2 , Console = 4 , World = 8 }
 A flag enum representing context where this command operates. More...
 
enum  EquipType {
  Head , Body , Legs , HandsOn ,
  HandsOff , Back , Front , Shoes ,
  Waist , Wings , Shield , Neck ,
  Face , Balloon , Beard
}
 This is an enum of all the types of equipment that exist. An equipment type is defined as a type or layer of texture that is drawn on the player (for example, body and shield and wings).
 
enum  Framework { NetCore , NetFramework , Mono , Unknown }
 
enum  ModSide { Both , Client , Server , NoSync }
 A ModSide enum defines how mods are synced between clients and servers. You can set your mod's ModSide from its build.txt file. More...
 
enum  MountTextureType {
  Back , BackGlow , BackExtra , BackExtraGlow ,
  Front , FrontGlow , FrontExtra , FrontExtraGlow
}
 This is an enum of all possible types of extra mount textures for custom mounts. Use these as keys in the extraTextures dictionary passed to Mod.AddMount to give your mount front and back textures.
 
enum  PrefixCategory {
  Melee , Ranged , Magic , AnyWeapon ,
  Accessory , Custom
}
 
enum  SceneEffectPriority {
  None , BiomeLow , BiomeMedium , BiomeHigh ,
  Environment , Event , BossLow , BossMedium ,
  BossHigh
}
 This enum dictates from low to high which SceneEffect selections take priority. Setting appropriate priority values is important so that your mod works well with other mods and vanilla selections. More...
 

Enumeration Type Documentation

◆ CommandType

A flag enum representing context where this command operates.

Enumerator
Chat 

Command can be used in Chat in SP and MP.

Server 

Command is executed by server in MP.

Console 

Command can be used in server console during MP.

World 

Command can be used in Chat in SP and MP, but executes on the Server in MP. (singleplayer ? Chat : Server)

◆ ModSide

A ModSide enum defines how mods are synced between clients and servers. You can set your mod's ModSide from its build.txt file.

Enumerator
Both 

The default value for ModSide. This means that the mod has effects both client-side and server-side. When a client connects to a server, this mod will be disabled if the server does not have it. If a client without this mod connects to a server with this mod, the server will send this mod to the client and enable it. In general all mods that add game content should use this.

Client 

This means that the mod only has effects client-side. This mod will not be disabled client-side if the server does not have it. This is useful for mods that only add controls (for example, keybinds), change textures/musics, etc.

Server 

This means that the mod only has effects server-side. The server will not send this mod to every client that connects.

NoSync 

This means that the mod could have effects client-side and could have effects server-side. The client will not download this mod if it connects to a server with this mod, and the client will not disable this mod if it connects to a server without this mod. If a client connects to a server and both have this mod, then IDs will still be synchronized. This is useful if you want optional extra features when both the client and server have this mod.

◆ PrefixCategory

Enumerator
Melee 

Can modify the size of the weapon

Ranged 

Can modify the shoot speed of the weapon

Magic 

Can modify the mana usage of the weapon

Custom 

Will not appear by default. Useful as prefixes for your own damage type.

◆ SceneEffectPriority

This enum dictates from low to high which SceneEffect selections take priority. Setting appropriate priority values is important so that your mod works well with other mods and vanilla selections.

Enumerator
None 

Represents no priority

BiomeLow 

Will override vanilla SceneEffect for Hallow, Ocean, Desert, Overworld, Night

BiomeMedium 

Will override vanilla SceneEffect for Dungeon, Meteor, Jungle, Snow

BiomeHigh 

Will override vanilla SceneEffect for Temple, Mushrooms, Corruption, Crimson,

Environment 

Will override vanilla SceneEffect for Sandstorm, Hell, Above surface during Eclipse, Space

Event 

Will override vanilla SceneEffect for Pirate Invasion, Goblin Invasion, Old Ones Army

BossLow 

All other bosses and default modded boss priority

BossMedium 

Will override vanilla SceneEffect for Martian Madness, Celestial Towers, Plantera

BossHigh 

Will override SceneEffect of Moon Lord