Skip to content

API Other

JonataOliveiraa edited this page Nov 14, 2026 · 1 revision
Reference

API reference · generated by tools/docs/ApiReference, do not edit by hand

Helpers and additions that do not belong to one topic.

AccessorySlotLoader

class Terraria.ModLoader.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.

Member Kind tModLoader What it does
int MaxVanillaSlotCount const same How many exist, with the game's and every mod's.
int TotalCount property only here How many exist, with the game's and every mod's.
ModAccessorySlot Get(int id, Player player) method same
ModAccessorySlot Get(int id) method same
AccessorySlotType ContextToEnum(int context) method same
bool ModdedIsItemSlotUnlockedAndUsable(int index, Player player) method same Checks if the ModAccessorySlot at the given index is enabled. Does not account for the functional or vanity slots individually being disabled due to conflicts arising from shared accessory slots.
bool ModdedIsSpecificItemSlotUnlockedAndUsable(int index, Player player, bool vanity) method same Like ModdedIsItemSlotUnlockedAndUsable, except this also checks if the functional or vanity slot specifically is disabled due to conflicts arising from switching loadouts while using shared accessory slots.
void CustomUpdateEquips(int index, Player player) method same
bool ModdedCanSlotBeShown(int index) method same
bool IsHidden(int index) method same Override to control whether or not drawing will be skipped during the given frame. NOTE: Nothing will be drawn, nor will subsequent drawing hooks be called on this slot for the frame while true
bool CanAcceptItem(int index, Item checkItem, int context) method same Override to set conditions on what can be placed in the slot. Default is to return false only when item property FitsAccessoryVanity says can't go in to a vanity slot. Return false to prevent the item going in slot. Return true for dyes, if you want dyes. Example: only wings can go in slot. Receives data: checkItem :: the item that is attempting to enter the slot
bool CanPlayerAcceptItem(Player player, int index, Item checkItem, int context) method same
void OnHover(int index, int context) method same
bool ModSlotCheck(Item checkItem, int slot, int context) method same Checks if the provided item can go in to the provided slot. Includes checking if the item already exists in either of Player.Armor or ModSlotPlayer.exAccessorySlot Invokes directly ItemSlot.AccCheck & ModSlot.CanAcceptItem Note that this doesn't check for conflicts of shared slots with the items of other loadouts, that check is done in DetectConflictsWithSharedSlots to prevent a confusing user experience. The accessory slot acts like a disabled slot while in conflict, allowing the player to choose how to fix the issue.
bool IsAccessoryInConflict(Player player, Item checkItem, int slot, int context) method same Similar to ModSlotCheck except it ignores the item in slot since that item is being passed in as checkItem.
void ModifyDefaultSwapSlot(Item item, ref int accSlotToSwapTo) method same After checking for empty slots in ItemSlot.AccessorySwap, this allows for changing what the target slot will be if the accessory isn't already equipped. DOES NOT affect vanilla behavior of swapping items like for like where existing in a slot
bool PreferredGolfBall(ref int projType) method same Mirrors Player.GetPreferredGolfBallToUse. Provides the golf ball projectile from an accessory slot.
int DrawVerticalAlignment static property not here The variable known as num20 used to align all equipment slot drawing in Main. Represents the y position where equipment slots start to be drawn from.
Vector2 DefenseIconPosition static property not here The variable that determines where the DefenseIcon will be drawn, after considering all slot information.
void DrawAccSlots(int num20) method not here
string[] scrollStackLang static field not here
bool Draw(int skip, bool modded, int slot, Color color) method not here Draws Vanilla and Modded Accessory Slots

AccessorySlotType

enum Terraria.ModLoader.AccessorySlotType

Values: FunctionalSlot, VanitySlot, DyeSlot

AddableFloat

struct Terraria.ModLoader.AddableFloat

A value that only adds, as in StatModifier.Base.

Member Kind tModLoader What it does
AddableFloat Zero static field same Nothing to add.
float Value property same The value.

AnchorData

struct Terraria.DataStructures.AnchorData

How a tile object attaches to what is around it.

Member Kind tModLoader What it does
AnchorData Empty static property same No anchor.
new AnchorData(AnchorType type, int tileCount, int checkStart) constructor same Creates an instance.

Animation

struct Terraria.Animation

What Bunny Loader adds to the game's tile animations.

Member Kind tModLoader What it does
int RegisterTemporaryAnimation(int frameRate, int[] frames) static method same Registers a temporary tile animation are returns a unique ID. The animation will play through the provided frames and the provided frameRate. Use the ID with NewTemporaryAnimation to trigger and sync the tempory tile animation.
int AnimationCount static property not here Internal to the game's class.
Dictionary<int, AnimationFrameData> AnimationFrameDatas static field not here Internal to the game's class.
void Unload() static method not here Internal to the game's class.

BasiliskMountJump

class Terraria.ModLoader.BasiliskMountJump : VanillaExtraJump

One of the game's extra jumps, as an ExtraJump you can position against or read from Player.GetJumpState.

Member Kind tModLoader What it does
float GetDurationMultiplier(Player player) override same Vanilla's jumps use the following values: Basilisk mount: 0.75 Blizzard in a Bottle: 1.5 Cloud in a Bottle: 0.75 Fart in a Jar: 2 Goat mount: 2 Sandstorm in a Bottle: 3 Santank mount: 2 Tsunami in a Bottle: 1.25 Unicorn mount: 2

BigEndianReader

class Terraria.ModLoader.IO.BigEndianReader : BinaryReader

A BinaryReader that reads big-endian numbers, for NBT files.

Member Kind tModLoader What it does
new BigEndianReader(Stream input) constructor same Creates an instance.
short ReadInt16() override same Reads a value with its most significant byte first.
ushort ReadUInt16() override same Reads a value with its most significant byte first.
int ReadInt32() override same Reads a value with its most significant byte first.
uint ReadUInt32() override same Reads a value with its most significant byte first.
long ReadInt64() override same Reads a value with its most significant byte first.
ulong ReadUInt64() override same Reads a value with its most significant byte first.
float ReadSingle() override same Reads a value with its most significant byte first.
double ReadDouble() override same Reads a value with its most significant byte first.

BigEndianWriter

class Terraria.ModLoader.IO.BigEndianWriter : BinaryWriter

A BinaryWriter that writes big-endian numbers, for NBT files.

Member Kind tModLoader What it does
new BigEndianWriter(Stream output) constructor same Creates an instance.
void Write(short value) override same Writes a value with its most significant byte first.
void Write(ushort value) override same Writes a value with its most significant byte first.
void Write(int value) override same Writes a value with its most significant byte first.
void Write(uint value) override same Writes a value with its most significant byte first.
void Write(long value) override same Writes a value with its most significant byte first.
void Write(ulong value) override same Writes a value with its most significant byte first.
void Write(float value) override same Writes a value with its most significant byte first.
void Write(double value) override same Writes a value with its most significant byte first.

BigProgressBarSystem

struct Terraria.GameContent.UI.BigProgressBar.BigProgressBarSystem

Member Kind tModLoader What it does
NeverValidProgressBar NeverValid property same
bool TryGetSpecialVanillaBossBar(int netID, out IBigProgressBar bossBar) method not here Gets the special IBigProgressBar associated with this vanilla NPCs netID (usually the type). Reminder: If no special bar exists or NPC.BossBar is not assigned, any NPC with a boss head index will automatically display a common boss bar shared among all simple bosses.

BiomeConversionID

static class Terraria.ID.BiomeConversionID

The game's conversion types, as WorldGen.Convert takes them.

Member Kind tModLoader What it does
int Count const same How many items it holds.

BlizzardInABottleJump

class Terraria.ModLoader.BlizzardInABottleJump : VanillaExtraJump

One of the game's extra jumps, as an ExtraJump you can position against or read from Player.GetJumpState.

Member Kind tModLoader What it does
float GetDurationMultiplier(Player player) override same Vanilla's jumps use the following values: Basilisk mount: 0.75 Blizzard in a Bottle: 1.5 Cloud in a Bottle: 0.75 Fart in a Jar: 2 Goat mount: 2 Sandstorm in a Bottle: 3 Santank mount: 2 Tsunami in a Bottle: 1.25 Unicorn mount: 2

BlockType

enum Terraria.BlockType

The shape of a tile: solid, half brick, slopes.

Values: Solid, HalfBlock, SlopeDownLeft, SlopeDownRight, SlopeUpLeft, SlopeUpRight

BuffDefinition

class Terraria.ModLoader.Config.BuffDefinition : EntityDefinition

BuffDefinition represents an Buff identity.

Member Kind tModLoader What it does
Func<TagCompound, BuffDefinition> DESERIALIZER static field same Rebuilds this value from a TagCompound.
int Type override same The buff's number now, found by name.
new BuffDefinition() constructor same Creates an instance.
new BuffDefinition(int type) constructor same Note: As ModConfig loads before other content, make sure to only use BuffDefinition for modded content in ModConfig classes.
new BuffDefinition(string key) constructor same Creates an instance.
new BuffDefinition(string mod, string name) constructor same Creates an instance.
BuffDefinition FromString(string s) static method same Builds this value from its text form.
BuffDefinition Load(TagCompound tag) static method same Rebuilds the definition from a tag.
string DisplayName override same The name shown to the player, as localized text.

BuffDrawParams

struct Terraria.DataStructures.BuffDrawParams

Holds data required for buff drawing.

Member Kind tModLoader What it does
Texture2D Texture field same The texture used for drawing the buff.
Vector2 Position field same Top-left position of the buff on the screen.
Vector2 TextPosition field same Top left position of the text below the buff (remaining time).
Rectangle SourceRectangle field same The frame displayed from the texture. Defaults to the entire texture size.
Rectangle MouseRectangle field same Defaults to the size of the autoloaded buffs' sprite, it handles mouseovering and clicking on the buff icon. If you offset the position, or have a non-standard size, change it accordingly.
Color DrawColor field same Color used to draw the buff. Use Main.buffAlpha[buffIndex] accordingly if you change it.
new BuffDrawParams(Texture2D texture, Vector2 position, Vector2 textPosition, Rectangle sourceRectangle, Rectangle mouseRectangle, Color drawColor) constructor same Creates an instance.
void Deconstruct(out Texture2D texture, out Vector2 position, out Vector2 textPosition, out Rectangle sourceRectangle, out Rectangle mouseRectangle, out Color drawColor) method same Takes the value apart in a var (a, b) = value assignment.

BuffID

struct Terraria.ID.BuffID

Buff types. A mod buff's type comes from ModContent.BuffType<T>().

Member Kind tModLoader What it does

BuffID.Sets

struct Terraria.ID.BuffID.Sets

Tables indexed by buff type.

Member Kind tModLoader What it does
BuffTextHandlerTable BuffTextHandlers static property differs The buffs whose time text comes from a handler. tML: Dictionary<int, IBuffTextHandler> BuffTextHandlers
ref bool[] IsATagBuff static property same Is a whip tag.
ref List<int>[] GrantImmunityWith static property differs An NPC will automatically become immune (buffImmune) to the indexed buff type if it is already immune to any buff in the corresponding List. For NPCs with ImmuneToWhipTags or ImmuneToRegularBuffs set to true, the reverse of that logic is used to automatically set the NPC as vulnerable: The NPC will automatically become vulnerable to the indexed buff type if it is specifically vulnerable to all of the buffs in the corresponding List. This set helps standardize several buff immunity inheritance rules that are effectively present in Terraria while providing modders the ability to do the same. For example, all NPC with immunity to OnFire are also immune to OnFire3 (aka, "On Fire!" and "Hellfire"). Modders can use this set to create buffs that act as variants of existing buffs, and should inherit the immunity value of those existing buffs. NPC from Terraria and other mods will automatically have these immunity rules applied, regardless of mod load order. tML: List<int>[] GrantImmunityWith

BuffID.Sets.BuffTextHandlerTable

class Terraria.ID.BuffID.Sets.BuffTextHandlerTable · only in Bunny Loader

Custom buff time text, per buff.

Member Kind tModLoader What it does
IBuffTextHandler this[int buffType] indexer only here Reads or writes one entry.
void Add(int buffType, IBuffTextHandler handler) method only here Sets the handler of a buff.
bool ContainsKey(int buffType) method only here Whether there is an entry for this ID.
bool TryGetValue(int buffType, out IBuffTextHandler handler) method only here Reads an entry if there is one.
bool Remove(int buffType) method only here Removes an entry.

BuilderToggle

abstract class Terraria.ModLoader.BuilderToggle : ModTexturedType

Represents a builder toggle button shown in the top left corner of the screen while the inventory is shown. These toggles typically control wiring-related visibility or other building-related quality of life features. The Active method determines if the BuilderToggle should be shown to the user and is usually reliant on player-specific values. The CurrentState property represents the current state of the toggle. For vanilla toggles a value of 0 is off and a value of 1 is on, but modded toggles can have NumberOfStates values.

Member Kind tModLoader What it does
BuilderToggle TorchBiome static property same The toggle of biome torches.
int Type property same This is the internal ID of this builder toggle. Also serves as the index for builderAccStatus.
string LocalizationCategory hook same The folder of this content in the localization files.
string HoverTexture hook same The outline texture drawn when the icon is hovered. By default a circular outline texture is used. Override this method and return Texture + "_Hover" or any other texture path to specify a custom outline texture for use with icons that are not circular.
bool Active() hook same This dictates whether or not this builder toggle should be active (displayed). This is usually determined by player-specific values, typically set in UpdateInventory.
int NumberOfStates hook same This is the number of different functionalities your builder toggle will have. For a toggle that has an On and Off state, you'd need 2 states!
Position OrderPosition hook same Modify this if you want your builder toggle have custom ordering. You can specify which BuilderToggle to sort before/after
string DisplayValue() hook same This is the value that will show up when hovering on the toggle icon. You can specify different values per each available CurrentState
bool Draw(SpriteBatch batch, ref BuilderToggleDrawParams drawParams) hook same This allows you to change basic drawing parameters or to override the vanilla drawing completely. This is for the icon itself. See DrawHover if you want to modify icon hover drawing. Return false to stop vanilla drawing code from running. Returns true by default.
bool DrawHover(SpriteBatch batch, ref BuilderToggleDrawParams drawParams) hook same This allows you to change basic drawing parameters or to override the vanilla drawing completely. This is for the icon hover. See Draw if you want to modify icon drawing. Return false to stop vanilla drawing code from running. Returns true by default.
bool OnLeftClick(ref SoundStyle sound) hook same Called when the toggle is left clicked and before vanilla operation takes place. Return false to stop vanilla left click code (switching between states and playing sound) from running. Returns true by default.
void OnRightClick() hook same Called when the toggle is right clicked. Use this if you want to implement special right click feature (such as cycling through states backwards).
int CurrentState property same This is the current state of this builder toggle. Every time the toggle is clicked, it will change. The default state is 0. The state will be saved and loaded for the player to be consistent.
BuilderToggle RulerLine static property not here The game's toggles are not exposed here, except TorchBiome.
BuilderToggle RulerGrid static property not here The game's toggles are not exposed here, except TorchBiome.
BuilderToggle AutoActuate static property not here The game's toggles are not exposed here, except TorchBiome.
BuilderToggle AutoPaint static property not here The game's toggles are not exposed here, except TorchBiome.
BuilderToggle RedWireVisibility static property not here The game's toggles are not exposed here, except TorchBiome.
BuilderToggle BlueWireVisibility static property not here The game's toggles are not exposed here, except TorchBiome.
BuilderToggle GreenWireVisibility static property not here The game's toggles are not exposed here, except TorchBiome.
BuilderToggle YellowWireVisibility static property not here The game's toggles are not exposed here, except TorchBiome.
BuilderToggle HideAllWires static property not here The game's toggles are not exposed here, except TorchBiome.
BuilderToggle ActuatorsVisibility static property not here The game's toggles are not exposed here, except TorchBiome.
BuilderToggle BlockSwap static property not here The game's toggles are not exposed here, except TorchBiome.
string VanillaHoverTexture static property not here The path to the texture vanilla info displays use when hovering over an info display.

BuilderToggle.After

class Terraria.ModLoader.BuilderToggle.After : Position

Places a builder toggle after another one.

Member Kind tModLoader What it does
BuilderToggle Toggle property same The toggle it follows.
new After(BuilderToggle toggle) constructor same Creates an instance.

BuilderToggle.Before

class Terraria.ModLoader.BuilderToggle.Before : Position

Places a builder toggle before another one.

Member Kind tModLoader What it does
BuilderToggle Toggle property same The toggle it comes before.
new Before(BuilderToggle toggle) constructor same Creates an instance.

BuilderToggle.Default

class Terraria.ModLoader.BuilderToggle.Default : Position

Places a builder toggle in its default spot.

Member Kind tModLoader What it does

BuilderToggle.Position

abstract class Terraria.ModLoader.BuilderToggle.Position

Where a builder toggle goes in the row.

Member Kind tModLoader What it does

BuilderToggleDrawParams

struct Terraria.DataStructures.BuilderToggleDrawParams

Holds data required for builder toggle drawing.

Member Kind tModLoader What it does
Texture2D Texture field same The icon or icon hover texture
Vector2 Position field same The position
Rectangle Frame field same The frame rectangle (aka source rectangle)
Color Color field same The color the icon or icon hover is drawn in. Defaults to White for icon, OurFavoriteColor (yellow) for icon hover.
float Scale field same The scale of the icon or icon hover
SpriteEffects SpriteEffects field same The spriteEffects
new BuilderToggleDrawParams() constructor same Creates an instance.

BuyItemCreationContext

class Terraria.DataStructures.BuyItemCreationContext : ItemCreationContext

Created in the context of a player buying an item from a shop. Very similar to in functionality.

Member Kind tModLoader What it does
Item DestinationStack field same An item stack that the bought item will be combined with (via OnStack).
NPC VendorNPC field same The NPC that this item was bought from.
new BuyItemCreationContext(Item destinationStack, NPC vendorNPC) constructor same Creates an instance.

CachedProjectileCounterBuffTextHandler

struct Terraria.DataStructures.CachedProjectileCounterBuffTextHandler

A buff text that counts a projectile, as minion buffs do.

Member Kind tModLoader What it does
new CachedProjectileCounterBuffTextHandler(params int[] projectileTypesToCount) constructor same Creates an instance.

CalculatedStyle

struct Terraria.UI.CalculatedStyle

The final position and size of an element, in pixels.

Member Kind tModLoader What it does
float X field same The left edge.
float Y field same The top edge.
float Width field same The width.
float Height field same The height.
new CalculatedStyle(float x, float y, float width, float height) constructor only here Creates an instance.
Rectangle ToRectangle() method same As a Rectangle.
Vector2 Position() method same The top left corner.
Vector2 Center() method same The center.
bool Contains(Vector2 point) method only here Whether a point is inside.

CameraModifierStack

struct Terraria.Graphics.CameraModifiers.CameraModifierStack

Main.instance.CameraModifiers: adds a screen shake or camera move.

Member Kind tModLoader What it does
void Add(IModCameraModifier modifier) method differs Adds a camera change. tML: void Add(ICameraModifier modifier)

Chains

static class Terraria.GameContent.ItemDropRules.Chains

Chains one rule to another with OnSuccess, OnFailedRoll, OnFailedConditions.

Member Kind tModLoader What it does
IItemDropRule OnSuccess(this IItemDropRule rule, IItemDropRule ruleToChain, bool hideLootReport) static method same Chains a rule that runs when this one drops.
IItemDropRule OnFailedRoll(this IItemDropRule rule, IItemDropRule ruleToChain, bool hideLootReport) static method same Chains a rule that runs when this one loses its roll.
IItemDropRule OnFailedConditions(this IItemDropRule rule, IItemDropRule ruleToChain, bool hideLootReport) static method same Chains a rule that runs when this one's conditions fail.
void ReportDroprates(List<IItemDropRuleChainAttempt> chainedRules, float personalDropRate, List<DropRateInfo> drops, DropRateInfoChainFeed ratesInfo) static method same Fills the chances the bestiary shows.

Chains.TryIfDoesntFillConditions

class Terraria.GameContent.ItemDropRules.Chains.TryIfDoesntFillConditions : IItemDropRuleChainAttempt

Runs the next rule when the conditions fail.

Member Kind tModLoader What it does
IItemDropRule RuleToChain property same The next rule.
bool hideLootReport field same Hides the next rule from the bestiary.
new TryIfDoesntFillConditions(IItemDropRule rule, bool hideLootReport) constructor same Creates an instance.
bool CanChainIntoRule(ItemDropAttemptResult parentResult) hook same Whether the next rule runs, after this result.
void ReportDroprates(float personalDropRate, List<DropRateInfo> drops, DropRateInfoChainFeed ratesInfo) hook same Fills the bestiary's chance for the chain.

Chains.TryIfFailedRandomRoll

class Terraria.GameContent.ItemDropRules.Chains.TryIfFailedRandomRoll : IItemDropRuleChainAttempt

Runs the next rule when the roll fails.

Member Kind tModLoader What it does
IItemDropRule RuleToChain property same The next rule.
bool hideLootReport field same Hides the next rule from the bestiary.
new TryIfFailedRandomRoll(IItemDropRule rule, bool hideLootReport) constructor same Creates an instance.
bool CanChainIntoRule(ItemDropAttemptResult parentResult) hook same Whether the next rule runs, after this result.
void ReportDroprates(float personalDropRate, List<DropRateInfo> drops, DropRateInfoChainFeed ratesInfo) hook same Fills the bestiary's chance for the chain.

Chains.TryIfSucceeded

class Terraria.GameContent.ItemDropRules.Chains.TryIfSucceeded : IItemDropRuleChainAttempt

Runs the next rule when this one drops.

Member Kind tModLoader What it does
IItemDropRule RuleToChain property same The next rule.
bool hideLootReport field same Hides the next rule from the bestiary.
new TryIfSucceeded(IItemDropRule rule, bool hideLootReport) constructor same Creates an instance.
bool CanChainIntoRule(ItemDropAttemptResult parentResult) hook same Whether the next rule runs, after this result.
void ReportDroprates(float personalDropRate, List<DropRateInfo> drops, DropRateInfoChainFeed ratesInfo) hook same Fills the bestiary's chance for the chain.

Collision

struct Terraria.Collision

What Bunny Loader adds to the game's collision.

Member Kind tModLoader What it does
void LaserScan(Vector2 samplingPoint, Vector2 directionUnit, float samplingWidth, float maxDistance, float[] samples) static method same Measures how far a beam goes before it hits a tile.
bool CheckAABBvLineCollision(Vector2 objectPosition, Vector2 objectDimensions, Vector2 lineStart, Vector2 lineEnd, float lineWidth, ref float collisionPoint) static method same Whether a line crosses a rectangle.

CommandLoader

static class Terraria.ModLoader.CommandLoader

This serves as the central class from which ModCommand functions are supported and carried out.

Member Kind tModLoader What it does
bool Matches(CommandType commandType, CommandType callerType) static method same Whether a command of this kind can run from this caller.
List<Tuple<string, string>> GetHelp(CommandType type) static method same The commands and their help texts.

CommonCode

static class Terraria.GameContent.ItemDropRules.CommonCode

Helpers that drop items, used by rules.

Member Kind tModLoader What it does
void DropItem(DropAttemptInfo info, int item, int stack, bool scattered) static method same Spawns a dropped item and syncs it.
int DropItem(Rectangle rectangle, IEntitySource entitySource, int itemId, int stack, bool scattered) static method same Spawns a dropped item and syncs it.
int DropItem(Vector2 position, IEntitySource entitySource, int itemId, int stack) static method same Spawns a dropped item and syncs it.

CommonDrop

class Terraria.GameContent.ItemDropRules.CommonDrop : NativeDropRule

Drops an item with a chance.

Member Kind tModLoader What it does
new CommonDrop(IntPtr pointer, Type nativeType) constructor differs Creates an instance. tML: new CommonDrop(int itemId, int chanceDenominator, int amountDroppedMinimum, int amountDroppedMaximum, int chanceNumerator)
new CommonDrop(int itemId, int chanceDenominator, int amountDroppedMinimum, int amountDroppedMaximum, int chanceNumerator) constructor same Creates an instance.
ref int itemId property differs The item. tML: int itemId
ref int chanceDenominator property differs The Y of a chance of X in Y. tML: int chanceDenominator
ref int amountDroppedMinimum property differs The smallest stack. tML: int amountDroppedMinimum
ref int amountDroppedMaximum property differs The largest stack. tML: int amountDroppedMaximum
ref int chanceNumerator property differs The X of a chance of X in Y. tML: int chanceNumerator

CommonDropNotScalingWithLuck

class Terraria.GameContent.ItemDropRules.CommonDropNotScalingWithLuck : CommonDrop

A CommonDrop that ignores luck.

Member Kind tModLoader What it does
new CommonDropNotScalingWithLuck(int itemId, int chanceDenominator, int amountDroppedMinimum, int amountDroppedMaximum) constructor only here Creates an instance.

CommonDropScalingWithOnlyBadLuck

class Terraria.GameContent.ItemDropRules.CommonDropScalingWithOnlyBadLuck : CommonDrop

A CommonDrop that only bad luck changes.

Member Kind tModLoader What it does
new CommonDropScalingWithOnlyBadLuck(int itemId, int chanceDenominator, int amountDroppedMinimum, int amountDroppedMaximum, int chanceNumerator) constructor same Creates an instance.
new CommonDropScalingWithOnlyBadLuck(int itemId, int chanceDenominator, int amountDroppedMinimum, int amountDroppedMaximum) constructor same Creates an instance.

CommonDropWithRerolls

class Terraria.GameContent.ItemDropRules.CommonDropWithRerolls : CommonDrop

A CommonDrop with more tries.

Member Kind tModLoader What it does
new CommonDropWithRerolls(int itemId, int chanceDenominator, int amountDroppedMinimum, int amountDroppedMaximum, int rerolls) constructor same Creates an instance.
ref int timesToRoll property differs How many tries it gets. tML: int timesToRoll

ContentSamples

static class Terraria.ID.ContentSamples

A ready sample of each item, NPC and projectile, set up with defaults.

Member Kind tModLoader What it does
GameString BestiaryCreditId(int npcNetId) static method only here The ID the bestiary credits a kill to.
BestiaryRarityStars NpcBestiaryRarityStars static property differs The stars of each NPC in the bestiary. tML: Dictionary<int, int> NpcBestiaryRarityStars
ProjectileSamples ProjectilesByType static property differs A projectile of each type, with its defaults. tML: Dictionary<int, Projectile> ProjectilesByType
ItemSamples ItemsByType static property differs An item of each type, with its defaults. tML: Dictionary<int, Item> ItemsByType

ContentSamples.BestiaryRarityStars

class Terraria.ID.ContentSamples.BestiaryRarityStars · only in Bunny Loader

Stars each NPC gets in the bestiary.

Member Kind tModLoader What it does
int this[int npcNetId] indexer only here Reads or writes one entry.
bool ContainsKey(int npcNetId) method same Whether there is an entry for this key.
bool TryGetValue(int npcNetId, out int stars) method only here Reads an entry if there is one.

ContentSamples.ItemSamples

class Terraria.ID.ContentSamples.ItemSamples · only in Bunny Loader

ContentSamples.ItemsByType.

Member Kind tModLoader What it does
Item this[int type] indexer only here Reads or writes one entry.
bool ContainsKey(int type) method same Whether there is an entry for this key.
bool TryGetValue(int type, out Item sample) method only here Reads an entry if there is one.

ContentSamples.ProjectileSamples

class Terraria.ID.ContentSamples.ProjectileSamples · only in Bunny Loader

ContentSamples.ProjectilesByType.

Member Kind tModLoader What it does
Projectile this[int type] indexer only here Reads or writes one entry.
bool ContainsKey(int type) method same Whether there is an entry for this key.
bool TryGetValue(int type, out Projectile sample) method only here Reads an entry if there is one.

CursorOverrideID

class Terraria.ID.CursorOverrideID

Cursor icons in the inventory.

Members: DefaultCursor, SmartCursor, Magnifiers, FavoriteStar, CameraLight, CameraDark, TrashCan, BackInventory, ChestToInventory, InventoryToChest, QuickSell, DefaultCursorOutline, SmartCursorOutline, GamepadSmartCursor, GamepadSmartCursorOutline, GamepadDefaultCursor, GamepadDefaultCursorOutline, GamepadSmartCursorAlt

CustomModConfigItemAttribute

class Terraria.ModLoader.Config.CustomModConfigItemAttribute : Attribute

Use this attribute to specify a custom UI element to be used for the annotated property, field, or class in the ModConfig UI.

Member Kind tModLoader What it does
Type Type property same The element class that draws the option.
new CustomModConfigItemAttribute(Type type) constructor same Creates an instance.

CycleAttribute

class Terraria.ModLoader.Config.CycleAttribute : Attribute

If present, this data will be presented as a cylc button. Currently only affects enums, causing the choices to be cycled by button clicks instead of the usual expanded panel.

Member Kind tModLoader What it does

DashID

static class Terraria.ID.DashID

Corresponds to values assigned to dashType.

Member Kind tModLoader What it does
int None const same
int TabiAndMasterNinjaGear const same
int ShieldOfCthulhu const same
int SolarFlare const same
int Unused4 const same
int CrystalAssassin const same

DrawAnimationVertical

struct Terraria.DataStructures.DrawAnimationVertical

An animation for Main.RegisterItemAnimation: frames stacked vertically.

Member Kind tModLoader What it does
new DrawAnimationVertical(int ticksperframe, int frameCount, bool pingPong) constructor same Creates an instance.

DrawData

struct Terraria.DataStructures.DrawData

A sprite waiting to be drawn, as the player draw layers use it.

Member Kind tModLoader What it does
new DrawData(Texture2D texture, Vector2 position, Color color) constructor same Creates an instance.
new DrawData(Texture2D texture, Vector2 position, Rectangle sourceRect, Color color) constructor same Creates an instance.
new DrawData(Texture2D texture, Vector2 position, Rectangle sourceRect, Color color, float rotation, Vector2 origin, float scale, SpriteEffects effect, float inactiveLayerDepth) constructor same Creates an instance.
new DrawData(Texture2D texture, Vector2 position, Rectangle sourceRect, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effect, float inactiveLayerDepth) constructor same Creates an instance.

DrawDataList

struct Terraria.DataStructures.DrawDataList : IEnumerable<DrawData> · only in Bunny Loader

The list a player draw layer adds its DrawData to.

Member Kind tModLoader What it does
int Count property only here How many items it holds.
ref DrawData this[int index] indexer only here Reads or writes one entry.
void Add(DrawData item) method only here Adds a sprite.
void Insert(int index, DrawData item) method only here Adds a sprite at a position.
void RemoveAt(int index) method only here Removes a sprite by position.
int RemoveAll(Predicate<DrawData> match) method only here Removes the sprites that match.
int FindIndex(Predicate<DrawData> match) method only here The position of the first match.
void Clear() method only here Removes every sprite.
IEnumerator<DrawData> GetEnumerator() method only here Walks the items in foreach.

DropAttemptInfo

struct Terraria.GameContent.ItemDropRules.DropAttemptInfo

What is happening when a rule runs: the NPC, player, item and the random source.

Member Kind tModLoader What it does
NPC npc field same The NPC that dropped, or null.
int item field same The bag or crate that was opened.
Player player field same The player it is for.
UnifiedRandom rng field same The random source.
bool IsInSimulation field same Whether it only measures chances for the bestiary.
bool IsExpertMode field same Whether the world is Expert.
bool IsMasterMode field same Whether the world is Master.

DropBasedOnExpertMode

class Terraria.GameContent.ItemDropRules.DropBasedOnExpertMode : NativeDropRule

Runs one rule in Expert and another in Normal.

Member Kind tModLoader What it does
new DropBasedOnExpertMode(IItemDropRule ruleForNormalMode, IItemDropRule ruleForExpertMode) constructor same The rule used in that mode.
IItemDropRule ruleForNormalMode property same The rule used in that mode.
IItemDropRule ruleForExpertMode property same The rule used in that mode.

DropBasedOnExtraGel

class Terraria.GameContent.ItemDropRules.DropBasedOnExtraGel : NativeDropRule

Runs a rule by the extra gel of a slime.

Member Kind tModLoader What it does
new DropBasedOnExtraGel(IItemDropRule ruleForNormal, IItemDropRule ruleForExtraGel) constructor same The rule used in that mode.
IItemDropRule ruleForNormal property same The rule used in that mode.
IItemDropRule ruleForExtraGel property same The rule used in that mode.

DropBasedOnMasterAndExpertMode

class Terraria.GameContent.ItemDropRules.DropBasedOnMasterAndExpertMode : NativeDropRule

Runs one of three rules by difficulty.

Member Kind tModLoader What it does
new DropBasedOnMasterAndExpertMode(IItemDropRule ruleForDefault, IItemDropRule ruleForExpertMode, IItemDropRule ruleForMasterMode) constructor same The rule used in that mode.
IItemDropRule ruleForDefault property same The rule used in that mode.
IItemDropRule ruleForExpertmode property same The rule used in that mode.
IItemDropRule ruleForMasterMode property same The rule used in that mode.

DropBasedOnMasterMode

class Terraria.GameContent.ItemDropRules.DropBasedOnMasterMode : NativeDropRule

Runs one rule in Master and another below it.

Member Kind tModLoader What it does
new DropBasedOnMasterMode(IItemDropRule ruleForDefault, IItemDropRule ruleForMasterMode) constructor same The rule used in that mode.
IItemDropRule ruleForDefault property same The rule used in that mode.
IItemDropRule ruleForMasterMode property same The rule used in that mode.

DropLocalPerClientAndResetsNPCMoneyTo0

class Terraria.GameContent.ItemDropRules.DropLocalPerClientAndResetsNPCMoneyTo0 : CommonDrop

Drops for each client, and takes the NPC's money away.

Member Kind tModLoader What it does
new DropLocalPerClientAndResetsNPCMoneyTo0(int itemId, int chanceDenominator, int amountDroppedMinimum, int amountDroppedMaximum, IItemDropRuleCondition optionalCondition) constructor same Creates an instance.
IItemDropRuleCondition condition property same The condition of this rule.

DropNothing

class Terraria.GameContent.ItemDropRules.DropNothing : NativeDropRule

Drops nothing. Useful in a chain.

Member Kind tModLoader What it does
new DropNothing() constructor same Creates an instance.

DropOneByOne

class Terraria.GameContent.ItemDropRules.DropOneByOne : NativeDropRule

Drops items one at a time, each with its chance.

Member Kind tModLoader What it does
new DropOneByOne(int itemId, Parameters parameters) constructor same Creates an instance.

DropOneByOne.Parameters

struct Terraria.GameContent.ItemDropRules.DropOneByOne.Parameters

The amounts and chances of a DropOneByOne.

Member Kind tModLoader What it does
int ChanceNumerator field same The chance of the whole drop.
int ChanceDenominator field same The chance of the whole drop.
int MinimumItemDropsCount field same How many chunks it splits into.
int MaximumItemDropsCount field same How many chunks it splits into.
int MinimumStackPerChunkBase field same The stack of each chunk.
int MaximumStackPerChunkBase field same The stack of each chunk.
int BonusMinDropsPerChunkPerPlayer field same Extra stack per chunk for each player.
int BonusMaxDropsPerChunkPerPlayer field same Extra stack per chunk for each player.

DropPerPlayerOnThePlayer

class Terraria.GameContent.ItemDropRules.DropPerPlayerOnThePlayer : CommonDrop

Drops one for each player, at the player.

Member Kind tModLoader What it does
new DropPerPlayerOnThePlayer(int itemId, int chanceDenominator, int amountDroppedMinimum, int amountDroppedMaximum, IItemDropRuleCondition optionalCondition) constructor same Creates an instance.
IItemDropRuleCondition condition property same The condition of this rule.

DropRateInfo

struct Terraria.GameContent.ItemDropRules.DropRateInfo

What the bestiary shows for a drop.

Member Kind tModLoader What it does
int itemId field same The item.
int stackMin field same The smallest stack.
int stackMax field same The largest stack.
float dropRate field same The chance, from 0 to 1.
List<IItemDropRuleCondition> conditions field same The conditions shown beside it.
new DropRateInfo(int itemId, int stackMin, int stackMax, float dropRate, List<IItemDropRuleCondition> conditions) constructor same Creates an instance.
void AddCondition(IItemDropRuleCondition condition) method same Adds a condition.

DropRateInfoChainFeed

struct Terraria.GameContent.ItemDropRules.DropRateInfoChainFeed

The chance carried along a rule chain, for the bestiary.

Member Kind tModLoader What it does
float parentDroprateChance field same The chance of the rules before this one.
List<IItemDropRuleCondition> conditions field same The conditions of the rules before this one.
new DropRateInfoChainFeed(float droprate) constructor only here Creates an instance.
void AddCondition(IItemDropRuleCondition condition) method same Adds a condition.
DropRateInfoChainFeed With(float multiplier) method same A copy with this chance multiplied in.

DropdownAttribute

class Terraria.ModLoader.Config.DropdownAttribute : Attribute

If present, this data will be presented as a drop down. Currently only affects enums, causing the choices to be displayed as a dropdown instead of the usual expanded panel.

Member Kind tModLoader What it does

Entity

struct Terraria.Entity

What Bunny Loader adds to the game's entity.

Member Kind tModLoader What it does
IEntitySource GetSource_TownSpawn() static method only here The source of a town NPC's arrival.
IEntitySource GetSource_NaturalSpawn() static method only here The source of a natural spawn.

EntityDefinition

abstract class Terraria.ModLoader.Config.EntityDefinition : TagSerializable

Classes implementing EntityDefinition serve to function as a way to save and load the identities of various Terraria objects. Only the identity is preserved, no other data such as stack size, damage, etc. These classes are well suited for ModConfig, but can be saved and loaded in a TagCompound as well. An EntityDefinition can potentially refer to content removed from a mod or content from a mod not currently enabled. Use IsUnloaded to check if this is the case, especially before using Type as an index into an array. It is usually desirable to preserve all unloaded EntityDefinition entries so user data is not lost, so structure your code accordingly.

Member Kind tModLoader What it does
string Mod field same The mod's name, or Terraria.
string Name field same The content's name.
bool IsUnloaded hook same Whether its mod is off.
int Type hook same The content ID of the content this EntityDefinition represents. Will be -1 for IsUnloaded EntityDefinition.
string DisplayName hook same The name shown to the player, as localized text.
new EntityDefinition() constructor same Creates an instance.
new EntityDefinition(string mod, string name) constructor same Creates an instance.
new EntityDefinition(string key) constructor same Creates an instance.
string Key property only here Mod/Name.
string Unloaded property only here Text shown when the mod is off.
bool Equals(object obj) override same Whether both hold the same value.
string ToString() override same The text form of this value.
int GetHashCode() override same The hash of this value.
TagCompound SerializeData() method same Writes the mod and name to a tag.
int ModType<T>(string mod, string name, Func<T, int> type) static method only here The number of a mod's content by name.

EntitySource_ShakeTree

struct Terraria.DataStructures.EntitySource_ShakeTree

The source of what falls from a shaken tree.

Member Kind tModLoader What it does
new EntitySource_ShakeTree(int x, int y) constructor only here Creates an instance.

EntitySource_TileBreak

struct Terraria.DataStructures.EntitySource_TileBreak

The source of what a broken tile drops.

Member Kind tModLoader What it does
new EntitySource_TileBreak(int tileCoordsX, int tileCoordsY, string context) constructor only here Creates an instance.

EntitySource_TileUpdate

struct Terraria.DataStructures.EntitySource_TileUpdate

Intended for mods to use when a tile spawns an entity due to periodic/random updating, rather than in response to a specific trigger.

Member Kind tModLoader What it does
int X property only here The tile's column.
int Y property only here The tile's row.

EquipType

enum Terraria.ModLoader.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).

Values: Head, Body, Legs, HandsOn, HandsOff, Back, Front, Shoes, Waist, Wings, Shield, Neck, Face, Balloon, Beard

ExpandAttribute

class Terraria.ModLoader.Config.ExpandAttribute : Attribute

Affects whether this data will be expanded by default. The default value currently is true. Use the constructor with 2 parameters to control if list elements should be collapsed or expanded.

Member Kind tModLoader What it does
bool Expand property same Whether the object starts open.
bool ExpandListElements property same Whether each list element starts open.
new ExpandAttribute(bool expand) constructor same Creates an instance.
new ExpandAttribute(bool expand, bool expandListElements) constructor same Creates an instance.

Extensions

static class Terraria.GameContent.ItemDropRules.Extensions

Chain methods as extensions of a rule.

Member Kind tModLoader What it does
SimpleItemDropRuleCondition ToDropCondition(this Condition condition, ShowItemDropInUI showItemDropInUI, bool showConditionInUI) static method same Turns a Condition into a drop condition.

ExtraJump

abstract class Terraria.ModLoader.ExtraJump : ModType

ExtraJump is a singleton, defining the properties and behaviour of midair extra jumps. Fields defining the state of a jump per player are stored in ExtraJumpState

Member Kind tModLoader What it does
ExtraJump Flipper static property same The extra jump of Flippers.
ExtraJump BasiliskMount static property same The extra jump of this mount.
ExtraJump GoatMount static property same The extra jump of this mount.
ExtraJump SantankMount static property same The extra jump of this mount.
ExtraJump UnicornMount static property same The extra jump of this mount.
ExtraJump SandstormInABottle static property same The extra jump of this accessory.
ExtraJump BlizzardInABottle static property same The extra jump of this accessory.
ExtraJump FartInAJar static property same The extra jump of this accessory.
ExtraJump TsunamiInABottle static property same The extra jump of this accessory.
ExtraJump CloudInABottle static property same The extra jump of this accessory.
Position BeforeMountJumps static field same Before the jumps of mounts.
Position MountJumpPosition static field same Among the jumps of mounts.
Position BeforeBottleJumps static field same Before the bottle jumps.
Position AfterBottleJumps static field same After the bottle jumps.
int Type property same The internal ID of this ExtraJump.
string ToString() override same The text form of this value.
Position GetDefaultPosition() hook same Returns this extra jump's default position in regard to the vanilla extra jumps. Make use of e.g. Before/After, and provide an extra jump. Recommended using one of: BeforeMountJumps, MountJumpPosition, BeforeBottleJumps, AfterBottleJumps NOTE: The position must specify a vanilla ExtraJump otherwise an exception will be thrown.
IEnumerable<Position> GetModdedConstraints() hook same Modded jumps are placed between vanilla jumps via GetDefaultPosition and, by default, are sorted in load order. This hook allows you to sort this jump before/after other modded jumps that were placed between the same two vanilla jumps. Example: yield return new After(ModContent.GetInstance<SimpleExtraJump>()); By default, this hook returns null, which indicates that this jump has no modded ordering constraints.
void ShowVisuals(Player player) hook same Spawn effects that should appear while the player is performing this jump here. Only runs while the jump is Active For example, the Sandstorm in a Bottle's dusts are spawned here.
bool CanShowVisuals(Player player) hook same Return false to prevent ShowVisuals from executing. By default, this hook returns whether the player is moving upwards with respect to gravDir
float GetDurationMultiplier(Player player) hook same Vanilla's jumps use the following values: Basilisk mount: 0.75 Blizzard in a Bottle: 1.5 Cloud in a Bottle: 0.75 Fart in a Jar: 2 Goat mount: 2 Sandstorm in a Bottle: 3 Santank mount: 2 Tsunami in a Bottle: 1.25 Unicorn mount: 2
bool CanStart(Player player) hook same An extra condition for whether this extra jump can be started. Used by vanilla for flippers (wet). Returns true by default.
void OnStarted(Player player, ref bool playSound) hook same This hook runs when the player uses this jump via pressing the jump key Effects that should appear when the jump starts can be spawned here. For example, the Cloud in a Bottle's initial puff of smoke is spawned here. To make the jump re-usable, set Available to true
void OnEnded(Player player) hook same This hook runs before Active is set from true to false Jumps end when their duration expires or when Enabled is no longer true. Jumps may end early via StopExtraJumpInProgress, called when a grappling hook is thrown, the player grabs onto a rope, or when the player is frozen, turned to stone or webbed.
void UpdateHorizontalSpeeds(Player player) hook same Modify the player's horizontal movement while performing this jump here. Only runs while the jump is Active Vanilla's jumps use the following values: Basilisk mount: runAcceleration *= 3; maxRunSpeed *= 1.5; Blizzard in a Bottle: runAcceleration *= 3; maxRunSpeed *= 1.5; Cloud in a Bottle: no change Fart in a Jar: runAcceleration *= 3; maxRunSpeed *= 1.75; Goat mount: runAcceleration *= 3; maxRunSpeed *= 1.5; Sandstorm in a Bottle: runAcceleration *= 1.5; maxRunSpeed *= 2; Santank mount: runAcceleration *= 3; maxRunSpeed *= 1.5; Tsunami in a Bottle: runAcceleration *= 1.5; maxRunSpeed *= 1.25; Unicorn mount: runAcceleration *= 3; maxRunSpeed *= 1.5;
void OnRefreshed(Player player) hook same This hook runs before Available is set to true in RefreshDoubleJumps This occurs at the start of the grounded jump and while the player is grounded, or when jumping off a grappling hook/rope.

ExtraJump.After

class Terraria.ModLoader.ExtraJump.After : Position

Places an extra jump after another one.

Member Kind tModLoader What it does
new After(ExtraJump parent) constructor same Creates an instance.

ExtraJump.Before

class Terraria.ModLoader.ExtraJump.Before : Position

Places an extra jump before another one.

Member Kind tModLoader What it does
new Before(ExtraJump parent) constructor same Creates an instance.

ExtraJump.Position

abstract class Terraria.ModLoader.ExtraJump.Position

Where an extra jump goes in the order the game tries them.

Member Kind tModLoader What it does
ExtraJump Target property same The jump it is placed against.

ExtraJumpLoader

static class Terraria.ModLoader.ExtraJumpLoader

Runs the extra jumps.

Member Kind tModLoader What it does
int ExtraJumpCount static property same How many exist, with the game's and every mod's.
IReadOnlyList<ExtraJump> OrderedJumps static property same Every jump, in the order they are spent.
ExtraJump Get(int index) static method same A jump by number.
void UpdateHorizontalSpeeds(Player player) static method same Modify the player's horizontal movement while performing this jump here. Only runs while the jump is Active Vanilla's jumps use the following values: Basilisk mount: runAcceleration *= 3; maxRunSpeed *= 1.5; Blizzard in a Bottle: runAcceleration *= 3; maxRunSpeed *= 1.5; Cloud in a Bottle: no change Fart in a Jar: runAcceleration *= 3; maxRunSpeed *= 1.75; Goat mount: runAcceleration *= 3; maxRunSpeed *= 1.5; Sandstorm in a Bottle: runAcceleration *= 1.5; maxRunSpeed *= 2; Santank mount: runAcceleration *= 3; maxRunSpeed *= 1.5; Tsunami in a Bottle: runAcceleration *= 1.5; maxRunSpeed *= 1.25; Unicorn mount: runAcceleration *= 3; maxRunSpeed *= 1.5;
void JumpVisuals(Player player) static method not here Internal here.
void ProcessJumps(Player player) static method not here Internal here.
void RefreshJumps(Player player) static method not here Internal here.

ExtraJumpState

struct Terraria.DataStructures.ExtraJumpState

A structure containing fields used to manage extra jumps Valid states for an extra jump are as follows: Enabled = false | The extra jump cannot be used. Available and Active will be false Enabled = true, Available = true, Active = false | The extra jump is ready to be consumed, but hasn't been consumed yet Enabled = true, Available = false, Active = true | The extra jump has been consumed and is currently in progress Enabled = true, Available = true, Active = true | The extra jump is currently in progress, but can be re-used again after it ends Enabled = true, Available = false, Active = false | The extra jump has been consumed and cannot be used again until extra jumps are refreshed

Member Kind tModLoader What it does
bool Enabled property same Whether the extra jump can be used. This property is set by Enable and Disable. This property is automatically set to false in ResetEffects. When false, Available and Active will also be false.
bool Available property same true if the extra jump has not been consumed. Will be set to false when the extra jump starts. Setting this field to false will effectively make the game think that the player has already used this extra jump. This property also checks Enabled when read. For a reusable jump (e.g. MultipleUseExtraJump from ExampleMod), this property should only be set to true in OnStarted.
bool Active property same Whether any effects (e.g. spawning dusts) should be performed after consuming the extra jump, but before its duration runs out. This property returns true while the extra jump is in progress, and returns false otherwise. While an extra jump is in progress, UpdateHorizontalSpeeds and ShowVisuals will be executed. This property also checks Enabled when read.
void Enable() method same Sets this extra jump to usable for this game tick. If you want to disable this extra jump, use Disable
void Disable() method same Forces this extra jump to be disabled, consuming it and preventing the usage of it during the current game tick in the process. If you want to disable all extra jumps, using blockExtraJumps is preferred.

FartInAJarJump

class Terraria.ModLoader.FartInAJarJump : VanillaExtraJump

One of the game's extra jumps, as an ExtraJump you can position against or read from Player.GetJumpState.

Member Kind tModLoader What it does
float GetDurationMultiplier(Player player) override same Vanilla's jumps use the following values: Basilisk mount: 0.75 Blizzard in a Bottle: 1.5 Cloud in a Bottle: 0.75 Fart in a Jar: 2 Goat mount: 2 Sandstorm in a Bottle: 3 Santank mount: 2 Tsunami in a Bottle: 1.25 Unicorn mount: 2

FilterManager

struct Terraria.Graphics.Effects.FilterManager

Filters.Scene: the full-screen filters.

Member Kind tModLoader What it does
Filter this[string key] indexer only here Reads or writes one entry.
Filter Activate(string name, Vector2 position, params object[] args) method only here Turns an effect on by name.
void Deactivate(string name, params object[] args) method same Turns an effect off by name.

FlavorTextBestiaryInfoElement

struct Terraria.GameContent.Bestiary.FlavorTextBestiaryInfoElement

The description of a bestiary page, by localization key.

Member Kind tModLoader What it does
new FlavorTextBestiaryInfoElement(string languageKey) constructor same Creates an instance.

FlipperJump

class Terraria.ModLoader.FlipperJump : VanillaExtraJump

One of the game's extra jumps, as an ExtraJump you can position against or read from Player.GetJumpState.

Member Kind tModLoader What it does
float GetDurationMultiplier(Player player) override same Vanilla's jumps use the following values: Basilisk mount: 0.75 Blizzard in a Bottle: 1.5 Cloud in a Bottle: 0.75 Fart in a Jar: 2 Goat mount: 2 Sandstorm in a Bottle: 3 Santank mount: 2 Tsunami in a Bottle: 1.25 Unicorn mount: 2
bool CanStart(Player player) override same Whether it can start now.

FromOptionsWithoutRepeatsDropRule

class Terraria.GameContent.ItemDropRules.FromOptionsWithoutRepeatsDropRule : NativeDropRule

Drops some items from a list, with no repeats.

Member Kind tModLoader What it does
new FromOptionsWithoutRepeatsDropRule(int dropCount, int[] options) constructor same Creates an instance.
int[] dropIds property same The items it picks from.
ref int dropCount property differs How many different items it gives. tML: int dropCount

GenBase

abstract class Terraria.WorldBuilding.GenBase

The base of a world generation step.

Member Kind tModLoader What it does
UnifiedRandom _random static property same The world generation's random source.
TileData _tiles static property differs The world's tiles. tML: Tile[, ] _tiles

GenPass

abstract class Terraria.WorldBuilding.GenPass : GenBase

One step of world generation, added in ModSystem.ModifyWorldGenTasks.

Member Kind tModLoader What it does
IntPtr Pointer property only here The pass's address in the game.
string Name property same The pass's name.
double Weight property same Its share of the progress bar.
bool Enabled property same Whether it runs.
new GenPass(string name, double loadWeight) constructor same Creates an instance.
void Disable() method same Stops it from running.
void Enable() method only here Lets it run.
void Apply(GenerationProgress progress, GameConfiguration configuration) method same Runs it.
void ApplyPass(GenerationProgress progress, GameConfiguration configuration) hook same The pass's own work.

GenerationProgress

struct Terraria.WorldBuilding.GenerationProgress

The progress text and value of a step.

Member Kind tModLoader What it does
new GenerationProgress() constructor same Creates an instance.

GenericDamageClass

class Terraria.ModLoader.GenericDamageClass : VanillaDamageClass

One of the game's damage classes. Reach it with DamageClass.X.

Member Kind tModLoader What it does
int LangKey override differs Which Lang.tip text names this class. tML: string LangKey
StatInheritanceData GetModifierInheritance(DamageClass damageClass) override same This lets you define the classes that this DamageClass will benefit from (other than itself) for the purposes of stat bonuses, such as damage and crit chance. This is used to allow extensive specifications for what your damage class can and can't benefit from in terms of other classes' stat bonuses.

GlobalBackgroundStyle

abstract class Terraria.ModLoader.GlobalBackgroundStyle : ModType

This class serves to collect functions that operate on any kind of background style, without being specific to one single background style.

Member Kind tModLoader What it does
void ChooseUndergroundBackgroundStyle(ref int style) hook same Allows you to change which underground background style is being used.
void ChooseSurfaceBackgroundStyle(ref int style) hook same Allows you to change which surface background style is being used.
void FillUndergroundTextureArray(int style, int[] textureSlots) hook same Allows you to change which textures make up the underground background by assigning their background slots/IDs to the given array. Index 0 is the texture on the border of the ground and sky layers. Index 1 is the texture drawn between rock and ground layers. Index 2 is the texture on the border of ground and rock layers. Index 3 is the texture drawn in the rock layer. The border images are 160x16 pixels, and the others are 160x96, but it seems like the right 32 pixels of each is a duplicate of the far left 32 pixels.
void ModifyFarSurfaceFades(int style, float[] fades, float transitionSpeed) hook same Allows you to modify the transparency of all background styles that exist. The style parameter is the current style that is being used.

GlobalLoot

struct Terraria.ModLoader.GlobalLoot : ILoot

This readonly struct is a simple shortcut for modifying global drop rules in an ItemDropDatabase.

Member Kind tModLoader What it does
new GlobalLoot(ItemDropDatabase database) constructor same Creates an instance.
List<IItemDropRule> Get(bool includeGlobalDrops) method same Every rule for all NPCs.
IItemDropRule Add(IItemDropRule entry) method same Adds a rule for all NPCs.
IItemDropRule Remove(IItemDropRule entry) method same Removes an entry.
void RemoveWhere(Predicate<IItemDropRule> predicate, bool includeGlobalDrops) method same Removes the rules that match.

GlobalType

abstract class Terraria.ModLoader.GlobalType : ModType

The base of every GlobalX.

Member Kind tModLoader What it does
short StaticIndex property same Index of this global in the list of all globals of the same type, in registration order
bool InstancePerEntity hook same Whether to create a new instance of this Global for every entity that exists. Useful for storing information on an entity. Defaults to false. Return true if you need to store information (have non-static fields).
bool AppliesToEntity(TEntity entity, bool lateInstantiation) hook same Use this to control whether or not this global should be run on the provided entity instance.
TGlobal NewInstance(TEntity target) hook same Only called if InstancePerEntity and AppliesToEntity(target, ...) are both true. Returning null is permitted but not recommended over AppliesToEntity for performance reasons. Only return null when the global is disabled based on some runtime property (eg world seed).
TGlobal Clone(TEntity from, TEntity to) hook same Create a copy of this instanced global. Called when an entity is cloned.
short PerEntityIndex property not here Index of this global in a EntityGlobals array -1 if this global does not have a SlotPerEntity
bool SlotPerEntity hook not here If true, the global will be assigned a PerEntityIndex at load time, which can be used to access the instance in the EntityGlobals array. If false, the global will be a singleton applying to all entities
bool ConditionallyAppliesToEntities hook not here Whether this global applies to some entities but not others
TResult GetGlobal<TResult>(int entityType, ReadOnlySpan<TGlobal> entityGlobals, TResult baseInstance) static method not here Internal here. Use GetGlobalItem, GetGlobalNPC and the like.
bool TryGetGlobal<TResult>(int entityType, ReadOnlySpan<TGlobal> entityGlobals, TResult baseInstance, out TResult result) static method not here Internal here. Use TryGetGlobalItem, TryGetGlobalNPC and the like.
bool IsCloneable hook not here Whether or not this type is cloneable. Cloning is supported if all reference typed fields in each sub-class which doesn't override Clone are marked with [CloneByReference]
void SetDefaults(TEntity entity) hook not here Allows you to set the properties of any and every instance that gets created.
TGlobal Instance(TEntity entity) method not here Internal here. Use GetGlobalItem, GetGlobalNPC and the like.

GoatMountJump

class Terraria.ModLoader.GoatMountJump : VanillaExtraJump

One of the game's extra jumps, as an ExtraJump you can position against or read from Player.GetJumpState.

Member Kind tModLoader What it does
float GetDurationMultiplier(Player player) override same Vanilla's jumps use the following values: Basilisk mount: 0.75 Blizzard in a Bottle: 1.5 Cloud in a Bottle: 0.75 Fart in a Jar: 2 Goat mount: 2 Sandstorm in a Bottle: 3 Santank mount: 2 Tsunami in a Bottle: 1.25 Unicorn mount: 2

ICustomAutoload

interface Terraria.ModLoader.ICustomAutoload

Provides a static abstract Autoload method for mods to implement their own autoloading for types where ILoadable does not suffice. Sample use cases: When the type has multiple instances of the same class To manually call some content registration methods during autoloading (eg ) To implement completely custom loading behavior in a library, consider making an interface that extends from

Member Kind tModLoader What it does
void Autoload(Mod mod) hook same Called instead of the normal loading.

IEntityWithGlobals

interface Terraria.ModLoader.IEntityWithGlobals

An entity with GlobalX instances.

Member Kind tModLoader What it does
IReadOnlyList<TGlobal> EntityGlobals hook differs The global instances of this object. tML: RefReadOnlyArray<TGlobal> EntityGlobals
int Type hook not here Not needed here.

ILoot

interface Terraria.ModLoader.ILoot

A list of drop rules: npcLoot and itemLoot in ModifyNPCLoot and ModifyItemLoot.

Member Kind tModLoader What it does
List<IItemDropRule> Get(bool includeGlobalDrops) hook same The rules.
IItemDropRule Add(IItemDropRule entry) hook same Adds a rule.
IItemDropRule Remove(IItemDropRule entry) hook same Removes an entry.
void RemoveWhere(Predicate<IItemDropRule> predicate, bool includeGlobalDrops) hook same Removes the rules that match.

IMapLayer

struct Terraria.Map.IMapLayer

A layer of the full map.

Member Kind tModLoader What it does
IMapLayer Digtoise static property same The map layer of the Digtoise.
IMapLayer BossBag static property same The map layer of a boss bag on the ground.
IMapLayer Spawn static property same The map layer of the spawn point.
IMapLayer TeamBasedSpawn static property same The map layer of team spawns.
IMapLayer Pylons static property same The map layer of pylons.
IMapLayer Pings static property same The map layer of pings.
bool Visible property same Whether it draws now.
void Hide() hook not here Not implemented.

IModCameraModifier

interface Terraria.Graphics.CameraModifiers.IModCameraModifier · only in Bunny Loader

A change to the camera, per frame.

Member Kind tModLoader What it does
string UniqueIdentity hook only here A name that keeps two of the same from stacking.
bool IsAScreenShake hook only here Whether the screen shake option turns it off.
bool Finished hook only here Whether it should be removed.
void Update(ref CameraInfo cameraInfo) hook only here Changes the camera in this frame.

IModParticle

interface Terraria.Graphics.Renderers.IModParticle · only in Bunny Loader

A particle you draw yourself.

Member Kind tModLoader What it does
bool ShouldBeRemovedFromRenderer hook only here Whether it should be removed.
void Update(ref ParticleRendererSettings settings) hook only here Runs each tick.
void Draw(ref ParticleRendererSettings settings, SpriteBatch spriteBatch) hook only here Draws the particle.

IModType

interface Terraria.ModLoader.IModType

Content with a mod and a name.

Member Kind tModLoader What it does
Mod Mod hook same The mod this belongs to.
string Name hook same The internal name of this instance.
string FullName hook same => $"{Mod.Name}/{Name}"

INestedItemDropRule

interface Terraria.GameContent.ItemDropRules.INestedItemDropRule : IItemDropRule

A rule that runs another rule.

Member Kind tModLoader What it does
ItemDropAttemptResult TryDroppingItem(DropAttemptInfo info, ItemDropRuleResolveAction resolveAction) hook same Tries to drop, and says how it went.

IPlant

interface Terraria.ModLoader.IPlant : ILoadable

Common to mod trees, palm trees and cactus.

Member Kind tModLoader What it does
int PlantTileId hook same The tile of this kind of plant.
int VanillaCount hook same How many the game has.
int[] GrowsOnTileId hook same The tiles it grows on.
Asset<Texture2D> GetTexture() hook same Its texture.
void SetStaticDefaults() hook same Sets it up.
void Load(Mod mod) hook same Runs when the mod loads.
void Unload() hook same Runs when the mod unloads.

IProvideItemConditionDescription

interface Terraria.GameContent.ItemDropRules.IProvideItemConditionDescription

A condition with text for the bestiary.

Member Kind tModLoader What it does
string GetConditionDescription() hook same The text that describes the condition in the bestiary.

ITree

interface Terraria.ModLoader.ITree : IPlant

Common to mod trees and palm trees.

Member Kind tModLoader What it does
TreeTypes CountsAsTreeType hook same The kind of tree it counts as.
int TreeLeaf() hook same The gore of its leaves.
bool Shake(int x, int y, ref bool createLeaves) hook same What falls when it is shaken.

ImmunityCooldownID

static class Terraria.ID.ImmunityCooldownID

The kinds of immunity after a hit.

Members: General, TileContactDamage, Bosses, BossNoCheese, DD2OgreKnockback, WrongBugNet, Lava, PaladinsShield, Count

InfoDisplay

abstract class Terraria.ModLoader.InfoDisplay : ModTexturedType

Represents an informational display toggle typically provided by informational accessories. The Active property determines if the InfoDisplay could be shown to the user. The game tracks the players desired visibility of active InfoDisplay through the hideInfo array.

Member Kind tModLoader What it does
Color InactiveInfoTextColor static property same The color when no valuable information is displayed.
Color GoldInfoTextColor static property same The golden color variant of the displays text. Used by the Lifeform Analyzer.
Color GoldInfoTextShadowColor static property same The golden color variant of the displays text shadow. Used by the Lifeform Analyzer.
string VanillaHoverTexture static property same The path to the texture vanilla info displays use when hovering over an info display.
string LocalizationCategory hook same The folder of this content in the localization files.
string HoverTexture hook same The outline texture drawn when the icon is hovered and toggleable. By default a circular outline texture is used. Override this method and return Texture + "_Hover" or any other texture path to specify a custom outline texture for use with icons that are not circular. Phone: Touch has no hover, so this outline is not drawn; tapping a toggle shows DisplayName instead.
LocalizedText DisplayName hook same This is the name that will show up when hovering over this info display.
bool Active() hook same This dictates whether or not this info display should be active. This is usually determined by player-specific values, typically set in UpdateInventory.
string DisplayValue(ref Color displayColor, ref Color displayShadowColor) hook same This is the value that will show up when viewing this display in normal play, right next to the icon. Set displayColor to InactiveInfoTextColor if your display value is "zero"/shows no valuable information.
InfoDisplay Watches static property not here The game's displays are not exposed as objects here.
InfoDisplay WeatherRadio static property not here The game's displays are not exposed as objects here.
InfoDisplay Sextant static property not here The game's displays are not exposed as objects here.
InfoDisplay FishFinder static property not here The game's displays are not exposed as objects here.
InfoDisplay MetalDetector static property not here The game's displays are not exposed as objects here.
InfoDisplay LifeformAnalyzer static property not here The game's displays are not exposed as objects here.
InfoDisplay Radar static property not here The game's displays are not exposed as objects here.
InfoDisplay TallyCounter static property not here The game's displays are not exposed as objects here.
InfoDisplay DPSMeter static property not here The game's displays are not exposed as objects here.
InfoDisplay Stopwatch static property not here The game's displays are not exposed as objects here.
InfoDisplay Compass static property not here The game's displays are not exposed as objects here.
InfoDisplay DepthMeter static property not here The game's displays are not exposed as objects here.
int Type property not here This is the internal ID of this InfoDisplay. Also serves as the index for hideInfo.

LeadingConditionRule

class Terraria.GameContent.ItemDropRules.LeadingConditionRule : NativeDropRule

A condition with no drop, that leads a chain.

Member Kind tModLoader What it does
new LeadingConditionRule(IItemDropRuleCondition condition) constructor same Creates an instance.
IItemDropRuleCondition condition property same The condition of this rule.

LegacyHairShaderData

struct Terraria.GameContent.Dyes.LegacyHairShaderData

A hair dye made of a color method.

Member Kind tModLoader What it does
new LegacyHairShaderData() constructor same Creates an instance.
LegacyHairShaderData UseLegacyMethod(HairColorMethod colorProcessor) method differs The method that gives the hair color. tML: LegacyHairShaderData UseLegacyMethod(ColorProcessingMethod colorProcessor)

LegacyNameAttribute

class Terraria.ModLoader.LegacyNameAttribute : Attribute

Allows for types to be registered with legacy/alias names for lookup via and similar methods. When manually loading content, use RegisterLegacyNames instead.

Member Kind tModLoader What it does
string[] Names field same The old names that still map to this content in a save.
new LegacyNameAttribute(params string[] names) constructor same Creates an instance.
IEnumerable<string> GetLegacyNamesOfType(Type type) static method not here Internal here.

LegacySoundStyle

struct Terraria.Audio.LegacySoundStyle

The game's sound by number.

Member Kind tModLoader What it does
bool HasValue property only here Whether it has a value.
LegacySoundStyle Value property only here The sound.

LoaderManager

static class Terraria.ModLoader.LoaderManager

Member Kind tModLoader What it does
T Get<T>() static method same

MagicDamageClass

class Terraria.ModLoader.MagicDamageClass : VanillaDamageClass

One of the game's damage classes. Reach it with DamageClass.X.

Member Kind tModLoader What it does
int LangKey override differs Which Lang.tip text names this class. tML: string LangKey

MagicSummonHybridDamageClass

class Terraria.ModLoader.MagicSummonHybridDamageClass : VanillaDamageClass

One of the game's damage classes. Reach it with DamageClass.X.

Member Kind tModLoader What it does
int LangKey override differs Which Lang.tip text names this class. tML: string LangKey
StatInheritanceData GetModifierInheritance(DamageClass damageClass) override same This lets you define the classes that this DamageClass will benefit from (other than itself) for the purposes of stat bonuses, such as damage and crit chance. This is used to allow extensive specifications for what your damage class can and can't benefit from in terms of other classes' stat bonuses.
bool GetEffectInheritance(DamageClass damageClass) override same This lets you define the classes that this DamageClass will count as (other than itself) for the purpose of armor and accessory effects, such as Spectre armor's bolts on magic attacks, or Magma Stone's Hellfire debuff on melee attacks. For a more in-depth explanation and demonstration, see ExampleMod's ExampleDamageClass.cs This method is only meant to be overridden. Modders should call CountsAsClass to query effect inheritance.

Main

struct Terraria.Main

What Bunny Loader adds to the game's main class.

Member Kind tModLoader What it does
Player CurrentPlayer static property same A replacement for LocalPlayer which respects whichever player is currently running hooks on the main thread. This works in the player select screen, and in multiplayer (when other players are updating). CurrentPlayerOverride can be used to temporarily override CurrentPlayer.
IEnumerable<WorldItem> ActiveItems static property differs Use to iterate over active world items. Game logic is usually only interested in active elements, this iterator facilitates that usage and allows for simpler and more readable code. Typically used in a foreach statement: foreach (var item in Main.ActiveItems) { // Code } This is equivalent to the less convenient approach: for (int i = 0; i < Main.maxItems; i++) { var item = Main.item[i]; if (!item.active) continue; // Code } Note that if the index of the WorldItem in the item array is needed, whoAmI can be used. tML: ActiveItemIterator ActiveItems
IEnumerable<Player> ActivePlayers static property differs Use to iterate over active players. Game logic is usually only interested in active elements, this iterator facilitates that usage and allows for simpler and more readable code. Typically used in a foreach statement: foreach (var player in Main.ActivePlayers) { // Code } This is equivalent to the less convenient approach: for (int i = 0; i < Main.maxPlayers; i++) { var player = Main.player[i]; if (!player.active) continue; // Code } Note that if the index of the Player in the player array is needed, whoAmI can be used. tML: ActivePlayerIterator ActivePlayers
void OpenShop(string shopName) method differs Opens a shop by name. tML: void OpenShop(int shopIndex)
ref SceneMetrics SceneMetrics static property differs What surrounds the local player: biomes, tile counts and so on. tML: SceneMetrics SceneMetrics
Color DiscoColor static property same A color that cycles through the colors like Rainbow Brick does.
void NewText(object o, Color color) static method differs Writes a line in the chat. tML: void NewText(string newText, Color color)
void EntitySpriteDraw(Texture2D texture, Vector2 position, Rectangle sourceRectangle, Color color, float rotation, Vector2 origin, float scale, SpriteEffects effects, float worthless) static method same Draws a sprite in the world.
void EntitySpriteDraw(Texture2D texture, Vector2 position, Rectangle sourceRectangle, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float worthless) static method same Draws a sprite in the world.
IEnumerable<NPC> ActiveNPCs static property differs Use to iterate over active players. Game logic is usually only interested in active elements, this iterator facilitates that usage and allows for simpler and more readable code. Typically used in a foreach statement: foreach (var npc in Main.ActiveNPCs) { // Code } This is equivalent to the less convenient approach: for (int i = 0; i < Main.maxNPCs; i++) { var npc = Main.npc[i]; if (!npc.active) continue; // Code } Note that if the index of the NPC in the npc array is needed, whoAmI can be used. tML: ActiveNPCIterator ActiveNPCs
IEnumerable<Projectile> ActiveProjectiles static property differs Use to iterate over active projectiles. Game logic is usually only interested in active elements, this iterator facilitates that usage and allows for simpler and more readable code. Typically used in a foreach statement: foreach (var projectile in Main.ActiveProjectiles) { // Code } This is equivalent to the less convenient approach: for (int i = 0; i < Main.maxProjectiles; i++) { var projectile = Main.projectile[i]; if (!projectile.active) continue; // Code } Note that if the index of the Projectile in the projectile array is needed, whoAmI can be used. tML: ActiveProjectileIterator ActiveProjectiles

MechBossSpawnersDropRule

class Terraria.GameContent.ItemDropRules.MechBossSpawnersDropRule : NativeDropRule

The spawners of the mechanical bosses.

Member Kind tModLoader What it does
new MechBossSpawnersDropRule() constructor same Creates an instance.

MeleeDamageClass

class Terraria.ModLoader.MeleeDamageClass : VanillaDamageClass

One of the game's damage classes. Reach it with DamageClass.X.

Member Kind tModLoader What it does
int LangKey override differs Which Lang.tip text names this class. tML: string LangKey

MeleeNoSpeedDamageClass

class Terraria.ModLoader.MeleeNoSpeedDamageClass : VanillaDamageClass

One of the game's damage classes. Reach it with DamageClass.X.

Member Kind tModLoader What it does
int LangKey override differs Which Lang.tip text names this class. tML: string LangKey
StatInheritanceData GetModifierInheritance(DamageClass damageClass) override same This lets you define the classes that this DamageClass will benefit from (other than itself) for the purposes of stat bonuses, such as damage and crit chance. This is used to allow extensive specifications for what your damage class can and can't benefit from in terms of other classes' stat bonuses.
bool GetEffectInheritance(DamageClass damageClass) override same This lets you define the classes that this DamageClass will count as (other than itself) for the purpose of armor and accessory effects, such as Spectre armor's bolts on magic attacks, or Magma Stone's Hellfire debuff on melee attacks. For a more in-depth explanation and demonstration, see ExampleMod's ExampleDamageClass.cs This method is only meant to be overridden. Modders should call CountsAsClass to query effect inheritance.

ModBackgroundStyle

abstract class Terraria.ModLoader.ModBackgroundStyle : ModType

Base of the mod backgrounds.

Member Kind tModLoader What it does
int Slot property same The ID of this underground background style.

ModSide

enum Terraria.ModLoader.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.

Values: Both, Client, Server, NoSync

MultipliableFloat

struct Terraria.ModLoader.MultipliableFloat

A value that only multiplies, as in StatModifier.

Member Kind tModLoader What it does
MultipliableFloat One static field same Nothing to multiply.
float Value property same The value.
new MultipliableFloat() constructor same Creates an instance.

NativeDropCondition

class Terraria.GameContent.ItemDropRules.NativeDropCondition : IItemDropRuleCondition · only in Bunny Loader

A condition of the mobile game, with a C# face.

Member Kind tModLoader What it does
bool CanDrop(DropAttemptInfo info) hook only here Runs the game's condition.
bool CanShowItemDropInUI() hook only here Whether the drop shows in the bestiary.
string GetConditionDescription() hook only here The text that describes the condition in the bestiary.

NativeDropRule

class Terraria.GameContent.ItemDropRules.NativeDropRule : IItemDropRule · only in Bunny Loader

A rule of the mobile game, with a C# face.

Member Kind tModLoader What it does
List<IItemDropRuleChainAttempt> ChainedRules property only here The rules chained to this one.
bool CanDrop(DropAttemptInfo info) hook only here Whether it can drop now.
ItemDropAttemptResult TryDroppingItem(DropAttemptInfo info) hook only here Tries to drop, and says how it went.
void ReportDroprates(List<DropRateInfo> drops, DropRateInfoChainFeed ratesInfo) hook only here Fills the chances the bestiary shows.

NetmodeID

static class Terraria.ID.NetmodeID

Correspond to netMode values.

Member Kind tModLoader What it does
int SinglePlayer const same
int MultiplayerClient const same
int Server const same
IdDictionary Search static field not here Not implemented.

NullAllowedAttribute

class Terraria.ModLoader.Config.NullAllowedAttribute : Attribute

This attribute means the annotated item can possibly be null. This will allow the UI to make the item null. It is up to the modder to make sure the item isn't null in the ModConfig constructor and nested classes.

Member Kind tModLoader What it does

OneFromOptionsDropRule

class Terraria.GameContent.ItemDropRules.OneFromOptionsDropRule : NativeDropRule

Drops one item from a list.

Member Kind tModLoader What it does
new OneFromOptionsDropRule(int chanceDenominator, int chanceNumerator, int[] options) constructor same Creates an instance.
int[] dropIds property same The items it picks from.
ref int chanceDenominator property differs The Y of a chance of X in Y. tML: int chanceDenominator
ref int chanceNumerator property differs The X of a chance of X in Y. tML: int chanceNumerator

OneFromOptionsNotScaledWithLuckDropRule

class Terraria.GameContent.ItemDropRules.OneFromOptionsNotScaledWithLuckDropRule : NativeDropRule

Drops one item from a list, ignoring luck.

Member Kind tModLoader What it does
new OneFromOptionsNotScaledWithLuckDropRule(int chanceDenominator, int chanceNumerator, int[] options) constructor same Creates an instance.
int[] dropIds property same The items it picks from.
ref int chanceDenominator property differs The Y of a chance of X in Y. tML: int chanceDenominator
ref int chanceNumerator property differs The X of a chance of X in Y. tML: int chanceNumerator

OneFromRulesRule

class Terraria.GameContent.ItemDropRules.OneFromRulesRule : NativeDropRule

Runs one rule from a list.

Member Kind tModLoader What it does
new OneFromRulesRule(int chanceDenominator, IItemDropRule[] options) constructor same Creates an instance.
IItemDropRule[] options property same The rules it picks from.
ref int chanceDenominator property differs The Y of a chance of X in Y. tML: int chanceDenominator

OverlayManager

struct Terraria.Graphics.Effects.OverlayManager

Overlays.Scene: the screen overlays.

Member Kind tModLoader What it does
Overlay this[string key] indexer only here Reads or writes one entry.
Overlay Activate(string name, Vector2 position, params object[] args) method only here Turns an effect on by name.
void Deactivate(string name, params object[] args) method only here Turns an effect off by name.

ParticleRenderer

struct Terraria.Graphics.Renderers.ParticleRenderer

Draws IParticle objects.

Member Kind tModLoader What it does
void Add(IModParticle particle) method differs Adds a particle. tML: void Add(IParticle particle)

PassLegacy

class Terraria.GameContent.Generation.PassLegacy : GenPass

A GenPass from a method.

Member Kind tModLoader What it does
new PassLegacy(string name, WorldGenLegacyMethod method) constructor same Creates an instance.
new PassLegacy(string name, WorldGenLegacyMethod method, double weight) constructor same Creates an instance.
void ApplyPass(GenerationProgress progress, GameConfiguration configuration) override same Calls the method given to the pass.

PlacementHook

struct Terraria.DataStructures.PlacementHook

A method called when a tile object is placed, for TileObjectData.newTile.

Member Kind tModLoader What it does
new PlacementHook(Func<int, int, int, int, int, int, int> hook, int badReturn, int badResponse, bool processedCoordinates) constructor only here Creates an instance.

Point

struct Microsoft.Xna.Framework.Point · only in Bunny Loader

What Bunny Loader adds to the point.

Member Kind tModLoader What it does
new Point(int x, int y) constructor XNA Creates an instance.

Point16

struct Terraria.DataStructures.Point16

A tile position in two short.

Member Kind tModLoader What it does
void Deconstruct(out int x, out int y) method only here Takes the value apart in a var (a, b) = value assignment.
Point16 Zero static field same The point (0, 0).
Point16 NegativeOne static field same The point (-1, -1).
new Point16(int x, int y) constructor same Creates an instance.

PosData

struct Terraria.ModLoader.PosData

A value at a position, in a sorted array, for sparse data by tile.

Member Kind tModLoader What it does
int pos field same The position as one number: x * Main.maxTilesY + y.
T value field same The value stored for the position.
int X property same The tile column.
int Y property same The tile row.
new PosData(int pos, T value) constructor same Creates an instance.
new PosData(int x, int y, T value) constructor same Creates an instance.
PosData<T> nullPosData static field same The empty value.
int CoordsToPos(int x, int y) static method same Gets a Position ID based on the x,y position. If using in an order sensitive case, see NextLocation.
int FindIndex<T>(this PosData<T>[] posMap, int x, int y) static method same Finds the entry of a position.
int FindIndex<T>(this PosData<T>[] posMap, int pos) static method same Finds the entry of a position.
PosData<T> Find<T>(this PosData<T>[] posMap, int pos) static method same Raw lookup function. Always returns the raw entry in the position map. Use if default values returned are a concern, as negative position returned are ~'null'
T Lookup<T>(this PosData<T>[] posMap, int x, int y) static method same General purpose lookup function. Always returns a value (even if that value is default). See OrderedSparseLookupBuilderfor more info
T Lookup<T>(this PosData<T>[] posMap, int pos) static method same General purpose lookup function. Always returns a value (even if that value is default). See OrderedSparseLookupBuilderfor more info
bool LookupExact<T>(this PosData<T>[] posMap, int x, int y, out T data) static method same For use with uncompressed sparse data lookups. Checks that the exact position exists in the lookup table.
bool LookupExact<T>(this PosData<T>[] posMap, int pos, out T data) static method same For use with uncompressed sparse data lookups. Checks that the exact position exists in the lookup table.
bool NearbySearchOrderedPosMap<T>(PosData<T>[] posMap, Point pt, int distance, out PosData<T> entry) static method same Searches around the provided point to check for the nearest entry in the map for OrdereredSparse data Doesn't work with 'compressed' lookups from OrderedSparseLookupBuilder

PosData.OrderedSparseLookupBuilder

class Terraria.ModLoader.PosData.OrderedSparseLookupBuilder

Efficient builder for [] lookups covering the whole world. Must add elements in ascending pos order.

Member Kind tModLoader What it does
new OrderedSparseLookupBuilder(int capacity, bool compressEqualValues, bool insertDefaultEntries) constructor same Use compressEqualValues to produce a smaller lookup which won't work with When using compressEqualValues without insertDefaultEntries, unspecified positions will default to the value of the previous specified position
void Add(int x, int y, T value) method same Adds a value. Positions must come in order.
void Add(int pos, T value) method same Adds a value. Positions must come in order.
PosData<T>[] Build() method same The finished array.

PosData.OrderedSparseLookupReader

class Terraria.ModLoader.PosData.OrderedSparseLookupReader

Reads a PosData array walking forward.

Member Kind tModLoader What it does
new OrderedSparseLookupReader(PosData<T>[] data, bool hasEqualValueCompression) constructor same Creates an instance.
T Get(int x, int y) method same The value at a position. Positions must be read in order.
T Get(int pos) method same The value at a position. Positions must be read in order.

PrefixCategory

enum Terraria.ModLoader.PrefixCategory

The kind of item a prefix fits.

Values: AnyWeapon, Melee, Ranged, Magic, Summon, Accessory, Custom

PrefixDefinition

class Terraria.ModLoader.Config.PrefixDefinition : EntityDefinition

PrefixDefinition represents a Prefix identity.

Member Kind tModLoader What it does
Func<TagCompound, PrefixDefinition> DESERIALIZER static field same Rebuilds this value from a TagCompound.
int Type override same The content ID of the content this EntityDefinition represents. Will be -1 for IsUnloaded EntityDefinition.
new PrefixDefinition() constructor same Creates an instance.
new PrefixDefinition(int type) constructor same Note: As ModConfig loads before other content, make sure to only use PrefixDefinition for modded content in ModConfig classes.
new PrefixDefinition(string key) constructor same Creates an instance.
new PrefixDefinition(string mod, string name) constructor same Creates an instance.
PrefixDefinition FromString(string s) static method same Builds this value from its text form.
PrefixDefinition Load(TagCompound tag) static method same Rebuilds the definition from a tag.
string DisplayName override same The name shown to the player, as localized text.

ProjAIStyleID

static class Terraria.ID.ProjAIStyleID

Values of Projectile.aiStyle.

Members: Arrow, ThrownProjectile, Boomerang, Vilethorn, FallingStar, Powder, Hook, Bounce, MagicMissile, FallingTile, FloatingFollow, Stream, Harpoon, GroundProjectile, Flail, Explosive, GraveMarker, Sickle, Spear, Drill, MusicNote, IceRod, Flames, CrystalShard, Boulder, Pet, Beam, ColdBolt, GemStaffBolt, Mushroom, Spray, BeachBall, Flare, FireWork, RopeCoil, SmallFlying, SpearTrap, FlameThrower, MechanicalPiranha, Leaf, FlowerPetal, CrystalLeaf, CrystalLeafShot, MoveShort, RainCloud, Rainbow, MagnetSphere, Ray, ExplosiveBunny, Inferno, LostSoul, Heal, FrostHydra, Raven, FlamingJack, FlamingScythe, NorthPoleSpear, Present, SpectreWrath, WaterJet, Bobber, Hornet, BabySpider, Nado, SharknadoBolt, MiniTwins, CommonFollow, MolotovCocktail, Flairon, FlaironBubble, Typhoon, Bubble, FireWorkFountain, ScutlixLaser, HeldProjectile, Crosshair, Electrosphere, Xenopopper, MartianDeathRay, MartianRocket, InfluxWaver, PhantasmalEye, PhantasmalSphere, ThickLaser, MoonLeech, IceMist, CursedFlameWall, LightningOrb, LightningRitual, MagicLantern, ShadowFlame, ToxicCloud, Nail, CoinPortal, ToxicBubble, IchorSplash, FlyingPiggyBank, MysteriousTablet, Yoyo, MedusaRay, HorizontalRay, LunarProjectile, Starmark, BrainofConfusion, SporeTrap, SporeGas, NebulaSphere, Vortex, MechanicWrench, NurseSyringe, DryadWard, SmallProximityExplosion, StickProjectile, PortalGate, TerrarianBeam, DrakomiteFlare, SolarEffect, NebulaArcanum, ArcanumSubShot, StardustGuardian, StardustDragon, ReleasedEnergy, LunarSentry, FloatInFrontPet, WireKite, Geyser, AncientStorm, AncientStormMark, SpiritFlame, DD2FlameBurst, DD2FlameBurstShot, DD2GrimEnd, DD2DarkSigil, DD2Ballista, UpwardExpand, DD2BetsysBreath, DD2LightningAura, DD2ExplosiveTrap, DD2ExplosiveTrapExplosion, SleepyOctopod, PoleSmash, ForwardStab, Ghast, FloatBehindPet, WisdomWhirlwind, DD2Victory, CelebrationMk2Shots, FallingStarAnimation, GolfBall, GolfClub, SuperStar, SuperStarBeam, ToiletEffect, VoidBag, SnakeCoil, Terraprisma, BloodThorn, Finch, PaperPlane, Kite, ShortSword, DesertTiger, Chum, DesertTigerBall, Whip, ReleasedProjectile, StellarTune, FirstFractal, EnchantedDagger, FairyGlowStick, FloatAndFly, SplitShotCore, EverlastingRainbow, WormPet, TitaniumShard, Reaping, CoolFlake, FireCracker, EtherealLance, SunDance, TwilightLance, Zenith, ZoologistStike, TorchGod, LifeDrain, PrincessWeapon, ShadowHand, LightsBane, Volcano, NightsEdge, TrueNightsEdge, JuminoAnimation, Flamethrower, HorsemanPumpkin, JimsDrone, Petal, CeilingAndHoverTurret, Flint, MeteorOre, BirdDroppings, ThrownMelee, TorchGodHelper, StormLightning, Digtoise, RemoteControlCar, ForbiddenMinion, SnappingStoneUnused, GlacierFangShot, ChlorophyteClaymoreBladeSlam, YoyoShots

Rectangle

struct Microsoft.Xna.Framework.Rectangle · only in Bunny Loader

What Bunny Loader adds to the rectangle.

Member Kind tModLoader What it does
new Rectangle(int x, int y, int width, int height) constructor XNA Creates an instance.
string ToString() override XNA The text form of this value.

ReinitializeDuringResizeArraysAttribute

class Terraria.ModLoader.ReinitializeDuringResizeArraysAttribute : Attribute

Classes annotated with this attribute will have their static constructor called again during the ResizeArrays stage of mod loading. This will happen before ResizeArrays is called for any mod. This is intended for classes containing ID sets created through SetFactory, similar to the design of vanilla classes such as Sets. This attribute removes the need to manually initialize these ID sets in ResizeArrays and helps avoid mod ordering issues that would complicate the implementation logic. This will not work on generic classes.

Member Kind tModLoader What it does

SandstormInABottleJump

class Terraria.ModLoader.SandstormInABottleJump : VanillaExtraJump

One of the game's extra jumps, as an ExtraJump you can position against or read from Player.GetJumpState.

Member Kind tModLoader What it does
float GetDurationMultiplier(Player player) override same Vanilla's jumps use the following values: Basilisk mount: 0.75 Blizzard in a Bottle: 1.5 Cloud in a Bottle: 0.75 Fart in a Jar: 2 Goat mount: 2 Sandstorm in a Bottle: 3 Santank mount: 2 Tsunami in a Bottle: 1.25 Unicorn mount: 2

SantankMountJump

class Terraria.ModLoader.SantankMountJump : VanillaExtraJump

One of the game's extra jumps, as an ExtraJump you can position against or read from Player.GetJumpState.

Member Kind tModLoader What it does
float GetDurationMultiplier(Player player) override same Vanilla's jumps use the following values: Basilisk mount: 0.75 Blizzard in a Bottle: 1.5 Cloud in a Bottle: 0.75 Fart in a Jar: 2 Goat mount: 2 Sandstorm in a Bottle: 3 Santank mount: 2 Tsunami in a Bottle: 1.25 Unicorn mount: 2

SetFactory

struct Terraria.ID.SetFactory

SetFactory is responsible for creating "custom ID sets" for content. "Custom ID sets" refers to arrays indexed by content ids. The ID set contains data applying to all instances of content of a specific type. This is typically metadata or data controlling how code will interact with each type of content. Each vanilla ID class contains a SetFactory instance called "Factory" which is used to initialize the ID sets contained within the ID class. For example Factory is used to initialize IsFood with true values for food items such as PadThai. Modded content updates ID sets in SetStaticDefaults: ItemID.Sets.IsFood[Type] = true;. Code in tModLoader and individual mods might consult the data in IsFood for whatever purpose they want. Mods can make their own custom ID sets through the methods of this class. The CreateNamedSet methods create custom ID sets that facilitate collaborative "named ID sets". Mods using the same "named ID set" will share a reference to the same array merging together all the entries and changes. More information can be found in the Custom and Named ID Sets pull request.

Member Kind tModLoader What it does
NamedSetKey CreateNamedSet(string fullKey) method same The final key for this named ID set using this overload will be "{key}" directly if it contains a "/". Otherwise, the final key will be derived automatically from the currently loading mod: "{loadingMod.Name}/{key}"
NamedSetKey CreateNamedSet(string modName, string key) method same The final key for this named ID set using this overload will be: "{modName}/{key}"
NamedSetKey CreateNamedSet(Mod mod, string key) method same The final key for this named ID set using this overload will be: "{mod.Name}/{key}" CreateNamedSet
GameArray<int> CreateIntSet(int defaultState, params int[] inputs) method same A game array of int with this default and these entries.
void MergeNamedSets<T>(params string[] inputSetNames) method not here Causes sets registered with the provided keys (and matching SetFactory and Type) to be merged as if they are registered with the same key. This is useful for situations where established set keys are determined to have identical meaning but the involved mods are incapable of updating to collaborate on the shared key, either due to dependent mods or inactivity. Essentially, the sets will be merged and share the same data. The default value must still be consistent between the sets. This must be called before the ResizeArrays stage of mod loading, such as in a Load method.
void ResizeArrays(bool unloading) static method not here Internal here.
void Clear() method not here Internal here.
BoolListSet CreateBoolListSet(params int[] types) method not here Not implemented.
void RegisterNamedCustomSet<T>(NamedSetKey setKey, T defaultValue, ref T[] input) method not here Manually registers a named ID set. This is typically done through the Terraria.ID.XID.Sets.Factory.CreateNamedSet().RegisterXSet() methods, but this method can be used for manually initialized arrays. The set reference passed in might be changed by this method when merging with existing data. Throws an exception if the data length or default value does not match a named ID set with the same key registered before this.

SetFactory.NamedSetKey

class Terraria.ID.SetFactory.NamedSetKey

Used to construct the key for this "named ID set". Must be chained with a RegisterXSet method to create and register the set for sharing.

Member Kind tModLoader What it does
NamedSetKey Description(string description) method same Adds a description to this named ID set. This description serves to communicate to other mod makers interested in interfacing with this set what the entries in the set mean and what your mod does with entries in the set. Multiple mods can register a description and they will all be available to view. Modders can use the "/customsets" chat command to output a complete listing of descriptions for all named ID sets to "CustomSets.txt" in the logs directory.
T[] RegisterCustomSet<T>(T defaultState, params object[] inputs) method same Creates or joins a named array that other mods share.
float[] RegisterFloatSet(float defaultState, params float[] inputs) method same Creates or joins a named float array.
ushort[] RegisterUshortSet(ushort defaultState, params ushort[] inputs) method same Creates or joins a named ushort array.
int[] RegisterIntSet(int defaultState, params int[] inputs) method same Creates or joins a named int array.
int[] RegisterIntSet(params int[] types) method same Creates or joins a named int array.
bool[] RegisterBoolSet(params int[] types) method same Creates or joins a named bool array.
bool[] RegisterBoolSet(bool defaultState, params int[] types) method same Creates or joins a named bool array.

SimpleItemDropRuleCondition

record Terraria.GameContent.ItemDropRules.SimpleItemDropRuleCondition : IItemDropRuleCondition

A condition made of a method and a text.

Member Kind tModLoader What it does
bool CanDrop(DropAttemptInfo info) method same Whether it can drop now.
bool CanShowItemDropInUI() method same Whether the drop shows in the bestiary.
string GetConditionDescription() method same The text that describes the condition in the bestiary.

SimpleModCloud

class Terraria.ModLoader.SimpleModCloud : ModCloud

A ModCloud made by Autoload from a texture in Clouds/.

Member Kind tModLoader What it does

SimpleModGore

class Terraria.ModLoader.SimpleModGore : ModGore

A ModGore made by Autoload from a texture in Gores/.

Member Kind tModLoader What it does

SkyManager

struct Terraria.Graphics.Effects.SkyManager

SkyManager.Instance: the custom skies.

Member Kind tModLoader What it does
CustomSky this[string key] indexer only here Reads or writes one entry.
CustomSky Activate(string name, Vector2 position, params object[] args) method only here Turns an effect on by name.
void Deactivate(string name, params object[] args) method same Turns an effect off by name.

SlimeBodyItemDropRule

class Terraria.GameContent.ItemDropRules.SlimeBodyItemDropRule : NativeDropRule

What a slime carries inside.

Member Kind tModLoader What it does
new SlimeBodyItemDropRule() constructor same Creates an instance.

SlopeType

enum Terraria.SlopeType : byte

The slope of a tile.

Values: Solid, SlopeDownLeft, SlopeDownRight, SlopeUpLeft, SlopeUpRight

SpriteFrame

struct Terraria.DataStructures.SpriteFrame

One frame of a sprite sheet.

Member Kind tModLoader What it does
new SpriteFrame(byte columns, byte rows, byte currentColumn, byte currentRow) constructor same Creates an instance.
new SpriteFrame(byte columns, byte rows) constructor same Creates an instance.

StatInheritanceData

struct Terraria.ModLoader.StatInheritanceData

How much one damage class takes from another.

Member Kind tModLoader What it does
StatInheritanceData Full static field same Inherits every stat.
StatInheritanceData None static field same Inherits nothing.
float damageInheritance field same How much damage it inherits.
float critChanceInheritance field same How much critical chance it inherits.
float attackSpeedInheritance field same How much attack speed it inherits.
float armorPenInheritance field same How much armor penetration it inherits.
float knockbackInheritance field same How much knockback it inherits.
new StatInheritanceData(float damageInheritance, float critChanceInheritance, float attackSpeedInheritance, float armorPenInheritance, float knockbackInheritance) constructor same Creates an instance.

StatueMimicItemDropRule

class Terraria.GameContent.ItemDropRules.StatueMimicItemDropRule : NativeDropRule

The drop of a statue mimic.

Member Kind tModLoader What it does
new StatueMimicItemDropRule() constructor same Creates an instance.

StyleDimension

struct Terraria.UI.StyleDimension

A position or size made of pixels plus a share of the parent.

Member Kind tModLoader What it does
StyleDimension Fill static field same The whole parent.
StyleDimension Empty static field same No size.
float Pixels field same The part in pixels.
float Precent field same The part as a fraction of the parent. The game's own spelling.
new StyleDimension(float pixels, float precent) constructor only here Creates an instance.
float Percent property same The part as a fraction of the parent.
void Set(float pixels, float precent) method same Sets both parts.
float GetValue(float containerSize) method same The result for a parent of this size.
StyleDimension FromPixels(float pixels) static method same A size in pixels.
StyleDimension FromPercent(float percent) static method same A size as a fraction of the parent.
StyleDimension FromPixelsAndPercent(float pixels, float percent) static method same A size with both parts.

SummonDamageClass

class Terraria.ModLoader.SummonDamageClass : VanillaDamageClass

One of the game's damage classes. Reach it with DamageClass.X.

Member Kind tModLoader What it does
int LangKey override differs Which Lang.tip text names this class. tML: string LangKey
bool UseStandardCritCalcs override same This lets you decide whether or not your damage class will use standard crit chance calculations. Setting this to false will also hide the critical strike chance line in the tooltip of any item that uses this DamageClass.
bool ShowStatTooltipLine(Player player, string lineName) override same Overriding this lets you disable standard statistical tooltip lines displayed on items associated with this DamageClass. All tooltip lines are enabled by default.
bool GetPrefixInheritance(DamageClass damageClass) override same This lets you define the classes that this DamageClass will count as (other than itself) for the purpose of prefixes. This method is only meant to be overridden. Modders should call GetsPrefixesFor to query prefix inheritance.

SummonMeleeSpeedDamageClass

class Terraria.ModLoader.SummonMeleeSpeedDamageClass : VanillaDamageClass

One of the game's damage classes. Reach it with DamageClass.X.

Member Kind tModLoader What it does
int LangKey override differs Which Lang.tip text names this class. tML: string LangKey
StatInheritanceData GetModifierInheritance(DamageClass damageClass) override same This lets you define the classes that this DamageClass will benefit from (other than itself) for the purposes of stat bonuses, such as damage and crit chance. This is used to allow extensive specifications for what your damage class can and can't benefit from in terms of other classes' stat bonuses.
bool GetEffectInheritance(DamageClass damageClass) override same This lets you define the classes that this DamageClass will count as (other than itself) for the purpose of armor and accessory effects, such as Spectre armor's bolts on magic attacks, or Magma Stone's Hellfire debuff on melee attacks. For a more in-depth explanation and demonstration, see ExampleMod's ExampleDamageClass.cs This method is only meant to be overridden. Modders should call CountsAsClass to query effect inheritance.
bool UseStandardCritCalcs override same This lets you decide whether or not your damage class will use standard crit chance calculations. Setting this to false will also hide the critical strike chance line in the tooltip of any item that uses this DamageClass.
bool ShowStatTooltipLine(Player player, string lineName) override same Overriding this lets you disable standard statistical tooltip lines displayed on items associated with this DamageClass. All tooltip lines are enabled by default.
bool GetPrefixInheritance(DamageClass damageClass) override same This lets you define the classes that this DamageClass will count as (other than itself) for the purpose of prefixes. This method is only meant to be overridden. Modders should call GetsPrefixesFor to query prefix inheritance.

SurfaceBackgroundStylesLoader

static class Terraria.ModLoader.SurfaceBackgroundStylesLoader

Registers the mod surface backgrounds.

Member Kind tModLoader What it does
int VanillaCount const only here How many exist, with the game's and every mod's.
int TotalCount static property only here How many exist, with the game's and every mod's.
ModSurfaceBackgroundStyle Get(int style) static method only here The style of a number, or null.
void ModifyFarFades(int style, float[] fades, float transitionSpeed) static method same Runs the style's far fade hook.
void DrawFarTexture() method not here Internal here.
void DrawMiddleTexture() method not here Internal here.
void DrawCloseBackground(int style) method not here Internal here.

TextureAssetArray

class Terraria.GameContent.TextureAssetArray · only in Bunny Loader

A table of the game's textures by type.

Member Kind tModLoader What it does
int Length property only here How many it holds.
Asset<Texture2D> this[int index] indexer only here The texture of an ID. Loads it when it is not loaded yet.

TextureAssets

static class Terraria.GameContent.TextureAssets

The game's textures by type: TextureAssets.Item[type].

Member Kind tModLoader What it does
TextureAssetArray Tile static property differs The game's textures of this kind, by ID. Reading one that is not loaded yet loads it. tML: Asset<Texture2D>[] Tile
TextureAssetArray Item static property differs The game's textures of this kind, by ID. Reading one that is not loaded yet loads it. tML: Asset<Texture2D>[] Item
TextureAssetArray Projectile static property differs The game's textures of this kind, by ID. Reading one that is not loaded yet loads it. tML: Asset<Texture2D>[] Projectile
TextureAssetArray Npc static property differs The game's textures of this kind, by ID. Reading one that is not loaded yet loads it. tML: Asset<Texture2D>[] Npc
TextureAssetArray Gore static property differs The game's textures of this kind, by ID. Reading one that is not loaded yet loads it. tML: Asset<Texture2D>[] Gore
TextureAssetArray NpcHead static property differs The game's textures of this kind, by ID. Reading one that is not loaded yet loads it. tML: Asset<Texture2D>[] NpcHead
TextureAssetArray PlayerHair static property differs The game's textures of this kind, by ID. Reading one that is not loaded yet loads it. tML: Asset<Texture2D>[] PlayerHair
TextureAssetArray PlayerHairAlt static property differs The game's textures of this kind, by ID. Reading one that is not loaded yet loads it. tML: Asset<Texture2D>[] PlayerHairAlt
TextureAssetArray Background static property differs The game's textures of this kind, by ID. Reading one that is not loaded yet loads it. tML: Asset<Texture2D>[] Background
TextureAssetArray Cloud static property differs The game's textures of this kind, by ID. Reading one that is not loaded yet loads it. tML: Asset<Texture2D>[] Cloud

ThrowingDamageClass

class Terraria.ModLoader.ThrowingDamageClass : VanillaDamageClass

One of the game's damage classes. Reach it with DamageClass.X.

Member Kind tModLoader What it does
int LangKey override differs Which Lang.tip text names this class. tML: string LangKey
bool GetPrefixInheritance(DamageClass damageClass) override same This lets you define the classes that this DamageClass will count as (other than itself) for the purpose of prefixes. This method is only meant to be overridden. Modders should call GetsPrefixesFor to query prefix inheritance.

ToFromStringConverter

class Terraria.ModLoader.Config.ToFromStringConverter : TypeConverter

This TypeConverter facilitates converting to and from the string Type. This is necessary for Objects that are to be used as Dictionary keys, since the JSON for keys needs to be a string. Classes annotated with this TypeConverter need to implement a static FromString method that returns T.

Member Kind tModLoader What it does
bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) override same Whether it converts to this type.
bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) override same Whether it converts from this type.
object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) override same Converts from text.

TreePaintingSettings

struct Terraria.GameContent.TreePaintingSettings

How a tree takes paint.

Member Kind tModLoader What it does
new TreePaintingSettings() constructor same Creates an instance.

TsunamiInABottleJump

class Terraria.ModLoader.TsunamiInABottleJump : VanillaExtraJump

One of the game's extra jumps, as an ExtraJump you can position against or read from Player.GetJumpState.

Member Kind tModLoader What it does
float GetDurationMultiplier(Player player) override same Vanilla's jumps use the following values: Basilisk mount: 0.75 Blizzard in a Bottle: 1.5 Cloud in a Bottle: 0.75 Fart in a Jar: 2 Goat mount: 2 Sandstorm in a Bottle: 3 Santank mount: 2 Tsunami in a Bottle: 1.25 Unicorn mount: 2

UndergroundBackgroundStylesLoader

static class Terraria.ModLoader.UndergroundBackgroundStylesLoader

This serves as the central class from which ModUndergroundBackgroundStyle functions are supported and carried out.

Member Kind tModLoader What it does
int VanillaUndergroundBackgroundStylesCount const same How many exist, with the game's and every mod's.
int VanillaCount const only here How many exist, with the game's and every mod's.
int TotalCount static property only here How many exist, with the game's and every mod's.
ModUndergroundBackgroundStyle Get(int style) static method only here The style of a number, or null.
void FillTextureArray(int style, int[] textureSlots) static method same Runs the style's texture hook.

UnicornMountJump

class Terraria.ModLoader.UnicornMountJump : VanillaExtraJump

One of the game's extra jumps, as an ExtraJump you can position against or read from Player.GetJumpState.

Member Kind tModLoader What it does
float GetDurationMultiplier(Player player) override same Vanilla's jumps use the following values: Basilisk mount: 0.75 Blizzard in a Bottle: 1.5 Cloud in a Bottle: 0.75 Fart in a Jar: 2 Goat mount: 2 Sandstorm in a Bottle: 3 Santank mount: 2 Tsunami in a Bottle: 1.25 Unicorn mount: 2

UnloadedAccessorySlot

class Terraria.ModLoader.Default.UnloadedAccessorySlot : ModAccessorySlot

Member Kind tModLoader What it does
string Name override same The internal name of this.
bool IsEnabled() override same Override to set conditions on when the slot is valid for stat/vanity calculations and player usage. Example: the demonHeart is consumed and in Expert mode in Vanilla.

Utils

static class Terraria.Utils

What Bunny Loader adds to the game's helpers.

Member Kind tModLoader What it does
Rectangle CornerRectangle(Point start, Point end) static method only here A rectangle between two corners.
void Swap<T>(ref T t1, ref T t2) static method same Swaps two values.
T Clamp<T>(T value, T min, T max) static method same Keeps a value between two limits.

UtilsExtensions

static class Terraria.UtilsExtensions

The extension methods tModLoader has in Utils, written here as extensions of the mobile game's types.

Member Kind tModLoader What it does
bool IndexInRange<T>(this T[] t, int index) static method same Whether the index is valid.
bool IndexInRange<T>(this List<T> t, int index) static method same Whether the index is valid.
int[] GetTrueIndexes(this bool[] values) static method same The positions that are true.
bool NextBool(this UnifiedRandom r) static method only here A random true or false. NextBool(5) is 1 in 5; NextBool(2, 5) is 2 in 5.
Vector2 ToWorldCoordinates(this Point p, float autoAddX, float autoAddY) static method same A tile position in pixels. By default the tile's center.
T Next<T>(this UnifiedRandom r, IList<T> choices) static method differs A random element of the list. tML: int Next(this UnifiedRandom random, IntRange range)
bool NextBool(this UnifiedRandom r, int consequent) static method only here A random true or false. NextBool(5) is 1 in 5; NextBool(2, 5) is 2 in 5.
bool NextBool(this UnifiedRandom r, int numerator, int denominator) static method only here A random true or false. NextBool(5) is 1 in 5; NextBool(2, 5) is 2 in 5.
float NextFloat(this UnifiedRandom r) static method same A random float.
float NextFloat(this UnifiedRandom r, float maxValue) static method differs A random float. tML: float NextFloat(this UnifiedRandom r)
float NextFloat(this UnifiedRandom r, float minValue, float maxValue) static method differs A random float. tML: float NextFloat(this UnifiedRandom r)
float NextFloatDirection(this UnifiedRandom r) static method same A random float from -1 to 1.
Vector2 NextVector2FromRectangle(this UnifiedRandom r, Rectangle rect) static method same A random point in a rectangle.
int ToDirectionInt(this bool value) static method same 1 for true, -1 for false.
bool IntersectsConeSlowMoreAccurate(this Rectangle targetRect, Vector2 coneCenter, float coneLength, float coneRotation, float maximumAngle) static method same Whether a rectangle touches a cone.
float ToRotation(this Vector2 v) static method same The angle of the vector.
Vector2 Floor(this Vector2 vec) static method same The vector rounded down.
Vector2 TopLeft(this Rectangle r) static method same The rectangle's top left corner.
Vector2 Size(this Rectangle r) static method same The size as a Vector2.
Point ToTileCoordinates(this Vector2 vec) static method same A position in pixels as a tile Point.
Point16 ToTileCoordinates16(this Vector2 vec) static method same A position in pixels as a Point16.
Vector2 ToWorldCoordinates(this Vector2 v, float autoAddX, float autoAddY) static method differs A tile position in pixels. By default the tile's center. tML: Vector2 ToWorldCoordinates(this Point p, float autoAddX, float autoAddY)
Vector2 ToWorldCoordinates(this Point16 p, float autoAddX, float autoAddY) static method differs A tile position in pixels. By default the tile's center. tML: Vector2 ToWorldCoordinates(this Point p, float autoAddX, float autoAddY)
Vector2 ToVector2(this Point16 p) static method differs The point as a Vector2. tML: Vector2 ToVector2(this Point p)
float AngleLerp(this float curAngle, float targetAngle, float amount) static method same Moves an angle toward another by a fraction, the short way.
Vector2 Size(this Texture2D texture) static method differs The size as a Vector2. tML: Vector2 Size(this Asset<Texture2D> tex)
Vector2 Size(this Asset<Texture2D> asset) static method differs The size as a Vector2. tML: Vector2 Size(this Asset<Texture2D> tex)
int Width(this Asset<Texture2D> asset) static method differs The texture's width. Waits for it to load. tML: int Width(this Asset<Texture2D> asset)
int Height(this Asset<Texture2D> asset) static method differs The texture's height. Waits for it to load. tML: int Height(this Asset<Texture2D> asset)
Rectangle Frame(this Texture2D tex, int horizontalFrames, int verticalFrames, int frameX, int frameY, int sizeOffsetX, int sizeOffsetY) static method differs One frame of a sprite sheet. tML: Rectangle Frame(this Asset<Texture2D> tex, int horizontalFrames, int verticalFrames, int frameX, int frameY, int sizeOffsetX, int sizeOffsetY)
Rectangle Frame(this Asset<Texture2D> tex, int horizontalFrames, int verticalFrames, int frameX, int frameY, int sizeOffsetX, int sizeOffsetY) static method differs One frame of a sprite sheet. tML: Rectangle Frame(this Asset<Texture2D> tex, int horizontalFrames, int verticalFrames, int frameX, int frameY, int sizeOffsetX, int sizeOffsetY)
Asset<T> Request<T>(this IAssetRepository repository, string assetName, AssetRequestMode mode) static method only here Loads an asset by path.
Vector2 RotatedBy(this Vector2 spinningpoint, double radians, Vector2 center) static method same The vector turned by this angle.
Vector2 RotatedByRandom(this Vector2 spinninpoint, double maxRadians) static method same The vector turned by a random angle up to this one.
Vector2 ToRotationVector2(this float f) static method same A unit vector at this angle.
Vector2 NextVector2Unit(this UnifiedRandom r, float startRotation, float rotationRange) static method same A random direction.
Vector2 NextVector2CircularEdge(this UnifiedRandom r, float circleHalfWidth, float circleHalfHeight) static method same A random point on the edge of an ellipse.
Vector2 NextVector2Square(this UnifiedRandom r, float min, float max) static method same A random point in a rectangle around zero.
Vector2 NextVector2Circular(this UnifiedRandom r, float circleHalfWidth, float circleHalfHeight) static method same A random point inside an ellipse.
Vector2 SafeNormalize(this Vector2 v, Vector2 defaultValue) static method same The unit vector, or the default when it has no length.
Color MultiplyRGBA(this Color first, Color second) static method differs Multiplies two colors. tML: Color MultiplyRGBA(this Color firstColor, Color secondColor)
Vector2 MoveTowards(this Vector2 value, Vector2 target, float amount) static method same The point moved toward a target, at most this far.
Vector2 DirectionTo(this Vector2 value, Vector2 target) static method same The unit vector toward a target.
Vector2 DirectionFrom(this Vector2 value, Vector2 target) static method same The unit vector away from a target.
Vector2 ClosestPointInRect(this Rectangle rectangle, Vector2 point) static method same The point of the rectangle closest to this one.
Point ToPoint(this Vector2 value) static method same The vector as a Point.
float AngleTowards(this float value, float target, float amount) static method same Turns an angle toward another, at most this much.
int ToInt(this bool value) static method same 1 for true, 0 for false.

VanillaDamageClass

abstract class Terraria.ModLoader.VanillaDamageClass : DamageClass

One of the game's damage classes. Reach it with DamageClass.X.

Member Kind tModLoader What it does
LocalizedText DisplayName override same This is the name that will show up when an item tooltip displays 'X [ClassName]'.
int LangKey hook differs Which Lang.tip text names this class. tML: string LangKey

VanillaExtraJump

abstract class Terraria.ModLoader.VanillaExtraJump : ExtraJump

One of the game's extra jumps, as an ExtraJump you can position against or read from Player.GetJumpState.

Member Kind tModLoader What it does

Vector2

struct Microsoft.Xna.Framework.Vector2 · only in Bunny Loader

A 2D vector of the game: position, velocity, scale. Generated proxy, with extras such as Vector2.One, Length and Normalize.

Member Kind tModLoader What it does
new Vector2(float x, float y) constructor XNA Creates an instance.
new Vector2(float value) constructor XNA Creates an instance.
bool Equals(object obj) override XNA Whether both hold the same value.
int GetHashCode() override XNA The hash of this value.
float LengthValue property XNA The vector's length. Only in Bunny Loader.
string ToString() override XNA The text form of this value.

Vector3

struct Microsoft.Xna.Framework.Vector3 · only in Bunny Loader

A 3D vector, also used for light and color values.

Member Kind tModLoader What it does
new Vector3(float x, float y, float z) constructor XNA Creates an instance.
string ToString() override XNA The text form of this value.

Vector4

struct Microsoft.Xna.Framework.Vector4 · only in Bunny Loader

A 4D vector, used for shader values and colors.

Member Kind tModLoader What it does
new Vector4(float x, float y, float z, float w) constructor XNA Creates an instance.

WallDefinition

class Terraria.ModLoader.Config.WallDefinition : EntityDefinition

WallDefinition represents a Wall identity.

Member Kind tModLoader What it does
Func<TagCompound, WallDefinition> DESERIALIZER static field same Rebuilds this value from a TagCompound.
int Type override same The content ID of the content this EntityDefinition represents. Will be -1 for IsUnloaded EntityDefinition.
new WallDefinition() constructor same Creates an instance.
new WallDefinition(int type) constructor same Note: As ModConfig loads before other content, make sure to only use WallDefinition for modded content in ModConfig classes.
new WallDefinition(string key) constructor same Creates an instance.
new WallDefinition(string mod, string name) constructor same Creates an instance.
WallDefinition FromString(string s) static method same Builds this value from its text form.
WallDefinition Load(TagCompound tag) static method same Rebuilds the definition from a tag.
string DisplayName override same The name shown to the player, as localized text.

WeightedRandom

class Terraria.Utilities.WeightedRandom

Picks an item by weight.

Member Kind tModLoader What it does
List<Tuple<T, double>> elements field same The choices and their weights.
bool needsRefresh field same Whether the total must be worked out again.
void Add(T element, double weight) method same Adds a choice with its weight.
T Get() method same Picks a choice.
void Clear() method same Removes every choice.

WhipSettings

struct Terraria.WhipSettings

What Bunny Loader adds to the whip settings.

Member Kind tModLoader What it does
int Segments field same How many segments it has.
float RangeMultiplier field same How far it reaches.

WhipTagEffect

struct Terraria.GameContent.Items.WhipTagEffect

What a whip's tag does to the minions' hits.

Member Kind tModLoader What it does
new WhipTagEffect() constructor same Creates an instance.

WingStats

struct Terraria.DataStructures.WingStats

The flight time and speed of a pair of wings.

Member Kind tModLoader What it does
WingStats Default static field same No wing flight.
new WingStats(int flyTime, float flySpeedOverride, float accelerationMultiplier, bool hasHoldDownHoverFeatures, float hoverFlySpeedOverride, float hoverAccelerationMultiplier) constructor same Creates an instance.

Wiring

static class Terraria.Wiring

What Bunny Loader adds to the game's wiring.

Member Kind tModLoader What it does
void HitSwitchAndSync(int i, int j) static method same Flips a switch and syncs it.

WorldFileData

struct Terraria.IO.WorldFileData

What Bunny Loader adds to the file data of a world.

Member Kind tModLoader What it does
bool TryGetHeaderData(ModSystem system, out TagCompound data) method same Reads what a ModSystem saved in the world's header.
bool TryGetHeaderData<T>(out TagCompound data) method same Reads what a ModSystem saved in the world's header.
bool TryGetModVersionGeneratedWith(string mod, out Version modVersion) method not here Retrieves the version that the specified mod was at when the world was generated. false will be returned for mods that were not enabled when the world was generated. The feature tracking which mods were used to generate a world was added in v2023.8, so modders should first check WorldGenModsRecorded to see if the mods used to generate the world were recorded at all.
bool WorldGenModsRecorded property not here If true, the mods used to generate this world have been saved and their version can be retrieved using TryGetModVersionGeneratedWith. If false, this world was generated before the feature tracking mods used to generate a world was added (v2023.8) and modders can't determine if a specific mod was enabled when the world was generated.

← Talking to the game  ·  Bunny Loader vs tModLoader →

Clone this wiki locally