MOD DEVELOPMENT

Mod Development Guide

Create your own mods using tModLoader's powerful C# API.

Prerequisites

Development Tools

  • Visual Studio 2022 (recommended)
  • JetBrains Rider (alternative)
  • VS Code with C# extension
  • .NET 6.0 SDK or newer

Required Knowledge

  • C# programming fundamentals
  • OOP concepts (classes, inheritance)
  • Terraria gameplay knowledge
  • Basic game dev understanding

Creating Your First Mod

Step 1: Setup Development Environment

Install Visual Studio and .NET SDK from official sources.

View detailed setup guide →

Step 2: Create Mod Project

  1. 1. Launch tModLoader
  2. 2. Go to "Workshop" → "Develop Mods"
  3. 3. Click "Create Mod"
  4. 4. Enter unique mod name (no spaces)
  5. 5. Click "Create"

Step 3: Understand Mod Structure

YourModName/
├── build.txt # Metadata
├── description.txt # Description
├── icon.png # 64x64 icon
├── YourModName.cs # Main class
├── Items/ # Custom items
├── NPCs/ # Custom NPCs
├── Projectiles/ # Projectiles
└── Tiles/ # Blocks/tiles

Understanding tModLoader API

tModLoader provides extensive hooks into Terraria's systems through C# classes.

Core Classes

  • • Mod (base mod class)
  • • ModItem (items/weapons)
  • • ModNPC (enemies/NPCs)
  • • ModProjectile (bullets)

World Content

  • • ModTile (blocks/tiles)
  • • ModWall (walls)
  • • ModBiome (biomes)
  • • ModWorld (world gen)

Effects & UI

  • • ModBuff (buffs/debuffs)
  • • ModDust (particles)
  • • ModSound (sounds)
  • • UIState (custom UI)

Learning Resources

Official GitHub Wiki

Most comprehensive resource with hundreds of examples and tutorials.

Coverage: All API classes with examples
Updates: Regularly maintained
Examples: 200+ code snippets
Community: Open for contributions
Visit GitHub Wiki

Video Tutorials

Learn visually with community tutorials on YouTube.

  • • Basic mod creation
  • • Advanced techniques
  • • Live coding sessions

Example Mods

Study source code from popular open-source mods.

  • • ExampleMod (official template)
  • • Community mod repositories
  • • Well-commented projects

Next Steps

Continue Learning