---
title: "How to Mod Terraria: tModLoader Setup and Your First Mod"
description: "Install tModLoader, add mods from the Workshop, then build your first Terraria mod: a custom item and an animated enemy with sprites, code and a recipe."
canonical_url: "https://spritesheetgenerator.online/guides/how-to-mod-terraria"
last_updated: 2026-11-05
meta:
  author: "Dennis Postma"
  "og:description": "Install tModLoader, add mods from the Workshop, then build your first Terraria mod: a custom item and an animated enemy with sprites, code and a recipe."
  "og:image": "https://spritesheetgenerator.online/guides/og-how-to-mod-terraria.png"
  "og:image:alt": "How to Mod Terraria: tModLoader Setup and Your First Mod"
  "og:title": "How to Mod Terraria: tModLoader Setup and Your First Mod"
  "twitter:image": "https://spritesheetgenerator.online/guides/og-how-to-mod-terraria.png"
  "twitter:image:alt": "How to Mod Terraria: tModLoader Setup and Your First Mod"
---

> Index of every page on this site: [llms.txt](https://spritesheetgenerator.online/llms.txt)

## Install tModLoader

If you own Terraria on Steam, search the store for **tModLoader** and install it. It is free and shows up as its own game in your library, so your vanilla Terraria stays untouched. Modded characters and worlds are saved in their own folder, so a mod that misbehaves cannot damage your vanilla saves.

## Install Mods

Launch tModLoader and open **Workshop**, then **Download Mods**. Browse or search, subscribe to what you like, and go back to **Manage Mods** to switch each one on. Click **Reload Mods** and they load.

Big content mods like Calamity or Thorium change progression a lot. A few things help:

- **Make a new character and world** for a heavily modded playthrough. Removing a content mod later can leave holes in a world that used its blocks.
- **Watch the loading screen.** When a mod fails, tModLoader names it and shows the error. Disable that one and the rest still work.
- **Save mod packs.** The Mod Packs screen in the Workshop menu stores a set of enabled mods, so you can flip between a light setup and a full overhaul.

## Set Up for Making Mods

Open **Workshop**, then **Develop Mods**. The first time, tModLoader checks for the .NET SDK it needs and tells you which version to install if it is missing. Do what it says; that screen knows its own requirements better than any guide.

You also want a code editor. Visual Studio Community or JetBrains Rider give you autocomplete for the whole Terraria API, which matters, because a lot of modding is finding out what a field is called.

Click **Create Mod**, fill in a name without spaces (say `MyFirstMod`), a display name and your name. tModLoader writes a project into:

```
Documents/My Games/Terraria/tModLoader/ModSources/MyFirstMod/
```

The template already contains one working sword. Back in Develop Mods, click **Build + Reload** next to your mod. When the game comes back, the sword is in the game. That loop, edit then Build + Reload, is how you will work from now on.

## How Textures Find Their Code

tModLoader matches textures to classes by path. A class `MyFirstMod.Content.Items.EmberBlade` in `Content/Items/EmberBlade.cs` uses the image at `Content/Items/EmberBlade.png`. There is no texture registration step. Name the file right and it loads.

![A file explorer with EmberBlade.cs next to EmberBlade.png in ModSources/MyFirstMod/Content/Items, linked to the matching namespace and class name in a code editor](https://spritesheetgenerator.online/guides/terraria-texture-pairing.svg)

*The namespace is the folder path and the class is the file name. Get both right and tModLoader finds the PNG by itself.*

When the PNG is missing or misnamed, the build still succeeds but loading fails with an error that names the path it looked for. Compare that path with your file and you have your answer.

## Draw at 2x

Terraria's pixel art uses 2x2 blocks: what looks like one pixel in the game is four pixels in the file. Vanilla sprites are all made this way, so a sprite drawn at 1x looks half the size of everything around it, with suspiciously fine detail.

Draw at 1x, because it is easier, then scale by exactly 2 with nearest-neighbor before you export. Never 1.5x or anything else that is not a whole number; the [pixel-perfect scaling guide](https://spritesheetgenerator.online/guides/pixel-perfect-scaling) explains what that does to the pixels. In this editor, **Scale 2x** in the Draw tab does it per frame without blurring, and **2x** in the sidebar's Pixel Cleanup panel doubles every frame in the layer at once.

![A 16x16 sword drawn at 1x, the Draw tab menu with Scale 2x highlighted, and the same sword at 32x32 where each art pixel is a 2x2 block](https://spritesheetgenerator.online/guides/terraria-2x-scaling.svg)

*Same sword, same art. At 2x every pixel becomes a 2x2 block, which is the size the rest of Terraria uses.*

## Make an Item

Here is a complete melee weapon with a recipe. Put it in `Content/Items/EmberBlade.cs` and the sprite next to it as `EmberBlade.png`:

```csharp
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace MyFirstMod.Content.Items
{
    public class EmberBlade : ModItem
    {
        public override void SetDefaults() {
            Item.width = 40;
            Item.height = 40;
            Item.damage = 24;
            Item.DamageType = DamageClass.Melee;
            Item.useTime = 20;
            Item.useAnimation = 20;
            Item.useStyle = ItemUseStyleID.Swing;
            Item.knockBack = 5;
            Item.value = Item.buyPrice(silver: 50);
            Item.rare = ItemRarityID.Orange;
            Item.UseSound = SoundID.Item1;
            Item.autoReuse = true;
        }

        public override void AddRecipes() {
            CreateRecipe()
                .AddIngredient(ItemID.HellstoneBar, 12)
                .AddTile(TileID.Anvils)
                .Register();
        }
    }
}
```

`useTime` and `useAnimation` are in ticks, and Terraria runs at 60 ticks per second, so 20 means three swings a second. `width` and `height` set the hitbox; match them roughly to the sprite.

The item's display name and tooltip do not go in the code. After a Build + Reload, tModLoader adds entries for the new item to the `.hjson` file in your mod's `Localization` folder. Fill them in there, and translators can later add other languages next to it.

## Make an Animated Enemy

Enemies are where sprite sheets come in. Terraria wants the frames of an NPC in **one column**, every frame the same height, first frame at the top. The game divides the image height by the frame count you set to find each frame.

This slime-like enemy borrows vanilla slime behavior and runs its own four-frame animation:

```csharp
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace MyFirstMod.Content.NPCs
{
    public class EmberSlime : ModNPC
    {
        public override void SetStaticDefaults() {
            Main.npcFrameCount[Type] = 4;
        }

        public override void SetDefaults() {
            NPC.width = 32;
            NPC.height = 24;
            NPC.damage = 14;
            NPC.defense = 4;
            NPC.lifeMax = 60;
            NPC.HitSound = SoundID.NPCHit1;
            NPC.DeathSound = SoundID.NPCDeath1;
            NPC.aiStyle = NPCAIStyleID.Slime;
            AIType = NPCID.BlueSlime;
        }

        public override void FindFrame(int frameHeight) {
            NPC.frameCounter++;
            if (NPC.frameCounter >= 10) {
                NPC.frameCounter = 0;
                NPC.frame.Y = (NPC.frame.Y + frameHeight) % (Main.npcFrameCount[Type] * frameHeight);
            }
        }

        public override float SpawnChance(NPCSpawnInfo spawnInfo) {
            return SpawnCondition.OverworldDaySlime.Chance * 0.3f;
        }
    }
}
```

`FindFrame` moves down one frame every 10 ticks, so six frames per second, and wraps back to the top. If you would rather copy a vanilla enemy's animation exactly, delete `FindFrame` and set `AnimationType = NPCID.BlueSlime;`, but then your sheet needs the same frame count and order as the vanilla one.

To build the sheet, put the frames in the [sprite sheet editor](https://spritesheetgenerator.online/features/sprite-sheet-creator), set **Columns** to 1, and export a PNG named `EmberSlime.png`. Check the result: if the image is 32 pixels wide and 4 frames of 24 pixels, it should be exactly 32x96.

![A four-frame ember slime stacked in one 32 pixel wide column, 96 pixels tall, beside the Columns 1 setting and the line Main.npcFrameCount\[Type\] = 4](https://spritesheetgenerator.online/guides/terraria-npc-strip.svg)

*One column, four frames of 24 px. The frame count in code is what turns the 96 px image back into frames.*

**Watch out**

If the frame count in code and the frames in the image disagree, you get a sprite that slides upward through its frames and shows slices of two at once. Count the frames in the PNG, then check `Main.npcFrameCount`.

## Retexture Without Code

You do not need tModLoader to change how vanilla Terraria looks. Terraria has built-in **resource packs**: a folder with a `pack.json` and replacement images in `Content/Images`, named exactly like the vanilla textures (`Item_1.png`, `NPC_1.png` and so on). Enable it in the game's Resource Packs menu. It is the simplest route if all you want is new art for existing things.

## Finding Art

Drawing everything yourself is the slow part of any content mod. The [gallery](https://spritesheetgenerator.online/gallery) has sheets other people published for anyone to reuse, including in mods, and the [Terraria mod sprites](https://spritesheetgenerator.online/mods/terraria) page shows the sizes that fit. Stick to original art: vanilla sprites belong to Re-Logic, and sprites ripped from other games are worse.

## Publish

Back in **Develop Mods**, click **Publish** next to your mod. tModLoader builds it, asks for a description and tags, and uploads it to the Steam Workshop. Bump the version in `build.txt` before each update so players know they have the new one.

**Stack your frames into one column and export the PNG.** [Open the editor](https://spritesheetgenerator.online/editor)

## **Try it in the editor**

The editor is free and needs no account. Open it in another tab and work through the steps above with your own frames.

[Open the editor](https://spritesheetgenerator.online/editor) [See all features](https://spritesheetgenerator.online/features)

## **Keep reading**

[**Modding****How to Mod Stardew Valley: SMAPI and Content Patcher Guide** 7 min read](https://spritesheetgenerator.online/guides/how-to-mod-stardew-valley "How to Mod Stardew Valley: SMAPI and Content Patcher Guide") [**Engines****Pixel-Perfect Scaling: Fix Blurry Pixel Art** 5 min read](https://spritesheetgenerator.online/guides/pixel-perfect-scaling "Pixel-Perfect Scaling: Fix Blurry Pixel Art") [**Engines****Import Sprite Sheets into Godot, Unity, Phaser and Construct** 7 min read](https://spritesheetgenerator.online/guides/import-sprite-sheets-game-engines "Import Sprite Sheets into Godot, Unity, Phaser and Construct")

---

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://spritesheetgenerator.online/#website","@type":"WebSite","description":"Free online tool to create spritesheets for game development. Upload sprites, arrange them, and export as a spritesheet with animation preview.","name":"Spritesheet Generator","url":"https://spritesheetgenerator.online/","publisher":{"@id":"https://spritesheetgenerator.online/#identity"}},{"@id":"https://spritesheetgenerator.online/guides/how-to-mod-terraria#webpage","@type":"WebPage","dateModified":"2026-11-05","datePublished":"2026-11-05","description":"Install tModLoader, add mods from the Workshop, then build your first Terraria mod: a custom item and an animated enemy with sprites, code and a recipe.","name":"How to Mod Terraria: tModLoader Setup and Your First Mod","url":"https://spritesheetgenerator.online/guides/how-to-mod-terraria","breadcrumb":{"@id":"https://spritesheetgenerator.online/guides/how-to-mod-terraria#breadcrumb"},"isPartOf":{"@id":"https://spritesheetgenerator.online/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://spritesheetgenerator.online/guides/how-to-mod-terraria"]}],"primaryImageOfPage":{"@id":"https://spritesheetgenerator.online/#logo"}},{"@id":"https://spritesheetgenerator.online/#identity","@type":"Organization","description":"A free, browser based sprite sheet generator for 2D game developers and pixel artists.","name":"Spritesheet Generator","url":"https://spritesheetgenerator.online","logo":{"@id":"https://spritesheetgenerator.online/#logo"},"sameAs":["https://discord.gg/2vvfqwn5k7"]},{"@id":"https://spritesheetgenerator.online/guides/how-to-mod-terraria#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Home","item":"https://spritesheetgenerator.online","position":1},{"@type":"ListItem","name":"Guides","item":"https://spritesheetgenerator.online/guides","position":2},{"@type":"ListItem","name":"How to Mod Terraria: tModLoader Setup and Your First Mod","item":"https://spritesheetgenerator.online/guides/how-to-mod-terraria","position":3}]},{"@id":"https://spritesheetgenerator.online/about#dennis-postma","@type":"Person","name":"Dennis Postma","url":"https://spritesheetgenerator.online/about","sameAs":["https://github.com/Dennis4720"]},{"@id":"https://spritesheetgenerator.online/guides/how-to-mod-terraria#article","dateModified":"2026-11-05","datePublished":"2026-11-05","description":"Install tModLoader, add mods from the Workshop, then build your first Terraria mod: a custom item and an animated enemy with sprites, code and a recipe.","headline":"How to Mod Terraria: tModLoader Setup and Your First Mod","inLanguage":"en","thumbnailUrl":"https://spritesheetgenerator.online/guides/og-how-to-mod-terraria.png","@type":["Article","TechArticle"],"articleSection":["Modding"],"author":{"@id":"https://spritesheetgenerator.online/about#dennis-postma"},"image":{"@id":"https://spritesheetgenerator.online/#/schema/image/1"},"isPartOf":{"@id":"https://spritesheetgenerator.online/guides/how-to-mod-terraria#webpage"},"mainEntityOfPage":{"@id":"https://spritesheetgenerator.online/guides/how-to-mod-terraria#webpage"},"publisher":{"@id":"https://spritesheetgenerator.online/#identity"}},{"@id":"https://spritesheetgenerator.online/#logo","@type":"ImageObject","caption":"Spritesheet Generator","contentUrl":"https://spritesheetgenerator.online/web-app-manifest-512x512.png","inLanguage":"en","url":"https://spritesheetgenerator.online/web-app-manifest-512x512.png"},{"@id":"https://spritesheetgenerator.online/#/schema/image/1","@type":"ImageObject","contentUrl":"https://spritesheetgenerator.online/guides/og-how-to-mod-terraria.png","inLanguage":"en","url":"https://spritesheetgenerator.online/guides/og-how-to-mod-terraria.png"}]}
```

## Sitemap

See the full [sitemap](https://spritesheetgenerator.online/sitemap.md) for all pages.
