tModLoader  0.12 Alpha
A mod to make and play Terraria mods
Terraria.ModLoader Namespace Reference

Classes

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.
 
class  BuildInfo
 
class  ChatCommandCaller
 
class  CombinedHooks
 
interface  CommandCaller
 
class  CommandLoader
 This serves as the central class from which ModCommand functions are supported and carried out.
 
class  CompassInfoDisplay
 
class  ConsoleCommandCaller
 
class  ContentInstance
 
class  DamageClass
 
struct  DamageClassData
 
class  DamageClassLoader
 
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.
 
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  FishFinderInfoDisplay
 
class  FrameworkVersion
 
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  GlobalRecipe
 This class provides hooks that control all recipes in the game. More...
 
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  ILoadable
 Allows for implementing types to be loaded and unloaded. More...
 
interface  ILoader
 
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...
 
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.
 
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
 
struct  MapEntry
 
class  MapLegend
 
class  MapLoader
 
class  MeleeDamageClass
 
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  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. The cactus will share a tile ID with the vanilla cacti (80), so that the cacti can freely convert between each other if the sand below is converted. This class encapsulates a function for retrieving the cactus's texture, the only difference between each type of cactus. Use ModTile.SetModCactus or GlobalTile.AddModCactus to make a tile able to grow this kind of cactus. 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.
 
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. 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. 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.
 
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. Use ModTile.SetModPalmTree or GlobalTile.AddModPalmTree to make a tile able to grow this kind of palm tree. 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. 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  ModSound
 This class allows you to customize how a sound you add is played. To use this, pass an instance to Mod.AddSound, or if you are autoloading sounds, give an overriding class the same name as the file with the sound you are adding. More...
 
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. 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. Use ModTile.SetModTree or GlobalTile.AddModTree to make a tile able to grow this kind of tree. 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.
 
class  MusicLoader
 
class  NoScalingDamageClass
 
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.
 
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.
 
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  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.
 
class  PosData
 
class  PrefixLoader
 
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.
 
class  RadarInfoDisplay
 
class  RangedDamageClass
 
class  RarityLoader
 
class  RecipeCreationContext
 
class  RecipeLoader
 This is where all Recipe and GlobalRecipe hooks are gathered and called.
 
struct  RefReadOnlyArray
 
class  SceneEffectLoader
 This serves as the central class from which SceneEffect functions are supported and carried out. More...
 
class  SextantInfoDisplay
 
class  SimpleModGore
 
class  SoundLoader
 This class is used to keep track of and support the existence of custom sounds that have been added to the game.
 
struct  StatModifier
 
class  StopwatchInfoDisplay
 
class  SummonDamageClass
 
class  SurfaceBackgroundStylesLoader
 
class  SystemLoader
 This is where all ModSystem hooks are gathered and called.
 
class  TallyCounterInfoDisplay
 
class  ThrowingDamageClass
 
class  TileLoader
 This serves as the central class from which tile-related functions are supported and carried out.
 
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.
 
class  WatchesInfoDisplay
 
class  WaterFallStylesLoader
 
class  WaterStylesLoader
 
class  WeatherRadioInfoDisplay
 

Enumerations

enum class  CommandType { Chat = 1 , Server = 2 , Console = 4 , World = 8 }
 A flag enum representing context where this command operates. More...
 
enum class  EquipType {
  Head , Body , Legs , HandsOn ,
  HandsOff , Back , Front , Shoes ,
  Waist , Wings , Shield , Neck ,
  Face , Balloon
}
 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). More...
 
enum class  Framework { NetCore , NetFramework , Mono , Unknown }
 
enum class  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 class  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. More...
 
enum class  PrefixCategory {
  Melee , Ranged , Magic , AnyWeapon ,
  Accessory , Custom
}
 
enum class  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...
 
enum class  SoundType { Item = 2 , NPCHit = 3 , NPCKilled = 4 , Custom = 50 }
 This is an enum of the types of sound you can add to the game. This is used for determining whether a sound is a music or a sound effect. If it's a sound effect, it's also used for determining the "type" passed to Main.PlaySound (first parameter) that is required in order for a sound to play; 2 for item sounds, 3 for npcHit sounds, 4 for npcKilled sounds, and SoundLoader.customSoundType for anything else. 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)

◆ EquipType

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

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

◆ MountTextureType

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.

◆ 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

◆ SoundType

This is an enum of the types of sound you can add to the game. This is used for determining whether a sound is a music or a sound effect. If it's a sound effect, it's also used for determining the "type" passed to Main.PlaySound (first parameter) that is required in order for a sound to play; 2 for item sounds, 3 for npcHit sounds, 4 for npcKilled sounds, and SoundLoader.customSoundType for anything else.