tModLoader v0.11.8.9
A mod to make and play Terraria mods
Terraria.ModLoader Namespace Reference

Namespaces

namespace  Audio
 
namespace  Config
 
namespace  Exceptions
 
namespace  IO
 

Classes

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  BuffLoader
 This serves as the central class from which buff-related functions are supported and carried out. More...
 
class  ChatCommandCaller
 
class  CombinedHooks
 
interface  CommandCaller
 
class  CommandManager
 This serves as the central class from which ModCommand functions are supported and carried out. More...
 
class  ConsoleCommandCaller
 
class  ContentInstance
 
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  DrawLayer
 This class represents a layer of the drawing of an object, using a certain type of InfoType to help with its drawing. More...
 
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  ErrorLogger
 NOTE: This class is deprecated. Use Logging instead (see ExampleMod for example) This class consists of functions that write error messages to text files for you to read. It also lets you write logs to text files. More...
 
class  FrameworkVersion
 
class  GlobalBgStyle
 This class serves to collect functions that operate on any kind of background style, without being specific to one single background style. More...
 
class  GlobalBgStyleLoader
 
class  GlobalBuff
 This class allows you to modify the behavior of any buff in the game. 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...
 
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  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  HotKeyLoader
 
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...
 
class  Logging
 
struct  MapEntry
 
class  MapLegend
 
class  MapLoader
 
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  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. 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. More...
 
class  ModGore
 This class allows you to customize the behavior of a custom gore. Create a new instance of this and pass it as a parameter to Mod.AddGore to customize the gore you are adding. If you are autoloading gore, then give it the same name as the gore texture. More...
 
class  ModHooks
 
class  ModHotKey
 Represents a loaded hotkey. It is suggested to access the hotkey status only in ModPlayer.ProcessTriggers. 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  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  ModMountData
 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 ModMountData will exist for each mount, so storing player specific data on the ModMountData 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...
 
struct  ModProperties
 This is a struct that stores the properties of a mod. Without setting it in your Mod constructor, all properties default to true. More...
 
class  ModRecipe
 This class extends Terraria.Recipe, meaning you can use it in a similar manner to vanilla recipes. However, it provides methods that simplify recipe creation. Recipes are added by creating new instances of ModRecipe, then calling the AddRecipe method. 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  ModSurfaceBgStyle
 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  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  ModUgBgStyle
 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  ModWorld
 A ModWorld instance represents an extension of a World. You can store fields in the ModWorld classes to keep track of mod-specific information on the world. It also contains hooks to insert your code into the world generation process. 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  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...
 
class  NPCSpawnHelper
 This server as a central class to help modders spawn their npcs. It's basically the vanilla spawn code if-else chains condensed into objects. See ExampleMod for usages. 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
 
struct  PlayerDrawInfo
 A struct that contains information that may help with PlayerLayer drawing. More...
 
struct  PlayerHeadDrawInfo
 A struct that contains information that may help with PlayerHeadLayer drawing. More...
 
class  PlayerHeadLayer
 This class represents a DrawLayer for the player's map icon, and uses PlayerDrawHeadInfo as its InfoType. Drawing should be done directly through drawInfo.spriteBatch. More...
 
class  PlayerHooks
 This is where all ModPlayer hooks are gathered and called. More...
 
class  PlayerLayer
 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  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  RecipeEditor
 This class allows you to make any changes you want to a recipe, whether it be adding/removing ingredients, changing the result, or removing the recipe entirely. More...
 
class  RecipeFinder
 This class will search through all existing recipes for you based on criteria that you give it. It's useful for finding a particular vanilla recipe that you wish to remove or edit. Use this by creating new instances with the empty constructor for each search you perform. More...
 
class  RecipeGroupHelper
 
class  RecipeHooks
 This is where all ModRecipe and GlobalRecipe hooks are gathered and called. More...
 
class  SoundLoader
 This class is used to keep track of and support the existence of custom sounds that have been added to the game. More...
 
class  SpawnCondition
 
class  SurfaceBgStyleLoader
 
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  UgBgStyleLoader
 This serves as the central class from which ModUgBgStyle functions are supported and carried out. More...
 
class  UsageException
 
class  WallLoader
 This serves as the central class from which wall-related functions are supported and carried out. More...
 
class  WaterfallStyleLoader
 
class  WaterStyleLoader
 This serves as the central class from which WaterStyle functions are supported and carried out. More...
 
class  WorldHooks
 This is where all ModWorld hooks are gathered and called. More...
 

Enumerations

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
}
 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  Framework { 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. More...
 
enum  MusicPriority {
  None , BiomeLow , BiomeMedium , BiomeHigh ,
  Environment , Event , BossLow , BossMedium ,
  BossHigh
}
 This enum dictates from low to high which music selections take priority. Setting appropriate MusicPriority values in Mod.UpdateMusic is important so that your mod works well with other mods and vanilla music selections. More...
 
enum  PrefixCategory {
  Melee , Ranged , Magic , AnyWeapon ,
  Accessory , Custom
}
 
enum  SoundType {
  Item = 2 , NPCHit = 3 , NPCKilled = 4 , Custom = 50 ,
  Music = 51
}
 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)

Definition at line 9 of file ModCommand.cs.

10 {
12 Chat = 1,
14 Server = 2,
16 Console = 4,
18 World = 8
19 }
@ 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 ?...

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

Enumerator
Head 
Body 
Legs 
HandsOn 
HandsOff 
Back 
Front 
Shoes 
Waist 
Wings 
Shield 
Neck 
Face 
Balloon 

Definition at line 6 of file EquipType.cs.

◆ Framework

Enumerator
NetFramework 
Mono 
Unknown 

Definition at line 8 of file FrameworkVersion.cs.

◆ 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, hotkeys), 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.

Definition at line 4 of file ModSide.cs.

5 {
7 Both,
9 Client,
11 Server,
13 NoSync
14 }
@ Both
The default value for ModSide. This means that the mod has effects both client-side and server-side....
@ Client
This means that the mod only has effects client-side. This mod will not be disabled client-side if th...
@ NoSync
This means that the mod could have effects client-side and could have effects server-side....

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

Enumerator
Back 
BackGlow 
BackExtra 
BackExtraGlow 
Front 
FrontGlow 
FrontExtra 
FrontExtraGlow 

Definition at line 6 of file MountTextureType.cs.

◆ MusicPriority

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

Enumerator
None 

Represents no priority

BiomeLow 

Hallow, Ocean, Desert, Overworld, Night

BiomeMedium 

Dungeon, Meteor, Jungle, Snow

BiomeHigh 

Temple, Mushrooms, Corruption, Crimson,

Environment 

Sandstorm, Hell, Above surface during Eclipse, Space

Event 

Pirate Invasion, Goblin Invasion, Old Ones Army

BossLow 

All other bosses and default modded boss priority

BossMedium 

Martian Madness, Celestial Towers, Plantera

BossHigh 

Moon Lord

Definition at line 7 of file MusicPriority.cs.

8 {
10 None,
20 Event,
22 BossLow,
27 }
@ Environment
Sandstorm, Hell, Above surface during Eclipse, Space
@ BiomeLow
Hallow, Ocean, Desert, Overworld, Night
@ BossLow
All other bosses and default modded boss priority
@ BiomeMedium
Dungeon, Meteor, Jungle, Snow
@ None
Represents no priority
@ BossMedium
Martian Madness, Celestial Towers, Plantera
@ Event
Pirate Invasion, Goblin Invasion, Old Ones Army
@ BiomeHigh
Temple, Mushrooms, Corruption, Crimson,

◆ 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

AnyWeapon 
Accessory 
Custom 

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

Definition at line 169 of file ModPrefix.cs.

170 {
174 Melee,
178 Ranged,
182 Magic,
183 AnyWeapon,
184 Accessory,
188 Custom
189 }
@ Magic
Can modify the mana usage of the weapon
@ Custom
Will not appear by default. Useful as prefixes for your own damage type.
@ Ranged
Can modify the shoot speed of the weapon
@ Melee
Can modify the size of the weapon

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

Enumerator
Item 
NPCHit 
NPCKilled 
Custom 
Music 

Definition at line 12 of file SoundType.cs.