ModLoader
Namespaces
- namespace IO
- None
Types
- type UgBgStyleLoader
- This serves as the central class from which ModUgBgStyle functions are supported and carried out.
- type SurfaceBgStyleLoader
- None
- type BackgroundTextureLoader
- This is the class that keeps track of all modded background textures and their slots/IDs.
- type BuffLoader
- This serves as the central class from which buff-related functions are supported and carried out.
- type CommandManager
- This serves as the central class from which ModCommand functions are supported and carried out.
- type PlayerDrawInfo
- A struct that contains information that may help with PlayerLayer drawing.
- type PlayerHeadDrawInfo
- A struct that contains information that may help with PlayerHeadLayer drawing.
- type 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.
- type 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.
- type 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).
- type ErrorLogger
- NOTE: This class is deprecated. Use
- type GLCallLocker
- FNA uses a single-threaded GL context. This class helps with tracking down related issues and deadlocks. See https://github.com/blushiemagic/tModLoader/issues/237 and https://github.com/FNA-XNA/FNA/blob/master/src/FNAPlatform/OpenGLDevice.cs#L4676 It also improves loading performance on FNA
- type GlobalBuff
- This class allows you to modify the behavior of any buff in the game.
- type 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.
- type 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.
- type 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.
- type GlobalRecipe
- This class provides hooks that control all recipes in the game.
- type 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.
- type 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.
- type 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.
- type 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.
- type 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.
- type 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.
- type GlobalBgStyle
- This class serves to collect functions that operate on any kind of background style, without being specific to one single background style.
- type ModBuff
- This class serves as a place for you to define a new buff and how that buff behaves.
- type CommandType
- A flag enum representing context where this command operates.
- type ModCommand
- This class represents a chat or console command. Use the CommandType to specify the scope of the command.
- type ModCompile
- None
- type 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.
- type 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.
- type 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.
- type ModContent
- Manages content added by mods. Liasons between mod content and Terraria's arrays and oversees the Loader classes.
- type 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.
- type 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.
- type ModHotKey
- Represents a loaded hotkey. It is suggested to access the hotkey status only in ModPlayer.ProcessTriggers.
- type 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.
- type ModLoader
- This serves as the central class which loads mods. It contains many static fields and methods related to mods and their contents.
- type 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.
- type 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.
- type ModOrganizer
- Responsible for sorting, dependency verification and organizing which mods to load
- type 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. ModPacket has all the same methods as BinaryWriter, and some additional ones.
- type 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.
- type ModPrefix
- None
- type 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.
- type ModProperties
- This is a struct that stores the properties of a mod. Without setting it in your Mod constructor, all properties default to true.
- type 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.
- type 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.
- type 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.
- type 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.
- type ModTileEntity
- Tile Entities are Entities tightly coupled with tiles, allowing the possibility of tiles to exhibit cool behavior. TileEntitry.Update is called in SP and on Server, not on Clients.
- type 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.
- type 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.
- type ModWaterfallStyle
- Represents a style of waterfalls that gets drawn. This is mostly used to determine the color of the waterfall.
- type 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.
- type 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.
- type 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.
- type 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.
- type 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.
- type RecipeHooks
- This is where all ModRecipe and GlobalRecipe hooks are gathered and called.
- type 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
- type 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.
- type WaterStyleLoader
- This serves as the central class from which WaterStyle functions are supported and carried out.
- type WorldHooks
- This is where all ModWorld hooks are gathered and called.
- type MountLoader
- This serves as the central place from which mounts are stored and mount-related functions are carried out.
- type 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.
- type 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.
- type 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.
- type 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.
- type DrawLayer`1
- This class represents a layer of the drawing of an object, using a certain type of InfoType to help with its drawing.
- type 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.
- type 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.
- type 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.
- type SoundLoader
- This class is used to keep track of and support the existence of custom sounds that have been added to the game.
- type 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.
- type TileLoader
- This serves as the central class from which tile-related functions are supported and carried out.
- type WallLoader
- This serves as the central class from which wall-related functions are supported and carried out.
- type PlayerHooks
- This is where all ModPlayer hooks are gathered and called.