• PC NEWS: update is out! More info here. Report bugs here
  • CONSOLE 1.4 NEWS: The current plan is to have Terraria: Journey's End out for Xbox and PlayStation in Q3 2021 (Jul-Sep). Switch will follow shortly afterwards. More info here. Stay up to date with console news here
  • MOBILE NEWS: Stay up to date with the latest mobile news here. Report mobile bugs here

Tool tDev - a proper developer mode for tAPI


tDev what?

tDev is a tool for mod makers. It's basically an addition to tAPI (tested with 14.a) with a few little tweaks geared towards developing and debugging your mod:

  • Uses a completely separate game folder. Where tAPI uses "My Games\Terraria\tAPI", tDev uses "My Games\Terraria\tDev".
    Never break your main game again when you accidentally use an unstable mod on your favourite world!

  • Lets you start the game with a debugger attached.
    It seems that tAPI has a bug where you can attach after the game is started, but only then. That's fixed now.

  • Lets you "Edit and Continue".
    That's right, grab an edition of Visual Studio, and off you go. Break, fix, run again - with no restarts required.

  • Lets you build your mod from the command line.
    Finally, developing a mod gets to be really seamless - just set up a post-build task, and you're done.

tDev how?

How do I use it, you mean?

If you're asking how it works, well, use the source, Luke. (tl;dr - patches tAPI with Mono.Cecil)

  • Download tDev and put it in your Terraria game folder. Same folder where tAPI.exe is.

  • You have two files - tDev.exe is the game, and tDev.Build.exe is a command-line mod builder.

  • Run tDev now. It will create its own config folder.

  • Set up your Visual Studio project as follows:
    • Assumptions:
      • Your username is "Mark IV McAwesome"
      • Your mod is called Mark.SuchAwesomeMod (internal name)
      • Your mod's source is in "C:\Code\Mark's Mod"
      • You installed the game in "C:\Games\Terraria"
    • Setup:
      • Add references to tAPI.exe and all Microsoft.Xna.*.dll files
      • Use [ "C:\Games\Terraria\tDev.exe" ] as your startup executable.
      • Use [ "C:\Games\Terraria\tDev.Build.exe" Mark.SuchAwesomeMod "C:\Code\Mark's Mod" ] as a post-build task.
      • Use [ "C:\Users\Mark IV McAwesome\Documents\My Games\Terraria\tDev\Mods\PDB" ] as your output path.

Yeah, we're using the PDB folder for our assembly, due to the way I hacked around the mod loader. Don't ask, don't tell.

(This last step is only needed if you intend to use "Edit and Continue", without it the mod will still load.)

When you're done with development, you can copy your mod package from "C:\Users\John\Documents\My Games\Terraria\tDev\Mods\Local", and put it in your main tAPI folder. Or just double-click it and let tAPI do that.

tDev where?

tDev on Dropbox. Download here (v1.0).

Or you can get the sources.

Don't expect much, the builder for the tDev binary is just an elaborate patcher of tAPI.

tDev I have other questions!

Ask away, I'll do my best to respond. I wrote this for myself, but maybe someone else could use it.
Last edited:


Yeah, target audience is basically people who already use an IDE and a debugger when creating and testing their mods. Geared towards Visual Studio, because that's what I use.

But if anyone wants to start, the community edition is free and awesome.
Also, noobish question. How do you actually do the final three steps (Startup-executable, post-build script, etc)? I'm fairly new to Visual Studio and such as you can see. I've been using Eclipse for the longest time :p


Well, VS refuses to cooperate with me today, so here's a quick guide which I will turn into an actual illustrated guide later on.

You want a C# class library project type.

Once your solution opens, right-click on your project in the solution explorer, and select "Properties". It should be the second entry in the box, the first being the whole solution.

Now, we're going to do all of our setup on this screen.
  • In the "Application" tab:
    • Set the "Assembly name" and "Default namespace" to your mod name, if it's not set already.
      By default it's whatever you typed in when creating the project.
    • Make sure "Target framework" is set to ".NET Framework 4".
    • Make sure "Output type" is set to "Class library".
  • In the "Build" tab:
    • In the "Configuration" drop-down, select "All configurations".
    • In the "Platform" drop-down, select "Active (x86)".
    • Make sure "Platform target" is set to "x86".
    • Make sure "Output path" is set to tDev's PDB directory (based on the first post).
  • In the "Build events" tab:
    • You want to set the "Post-build event command line", you have two options here.
    • Option 1 - set it to [ C:\Somewhere\Terraria\tDev.Build.exe "$(TargetName)" "$(ProjectDir)\" ], this assumes you set the "Assembly name" to your mod's internal name (which you should).
    • Option 2 - replace "$(TargetName)" with your mod's internal name by hand, and replace "$(ProjectDir)\" with the full path to your mod (where ModBase.cs and ModInfo.json are).
    • Important! If you're writing the full path, it must have a very specific form, it must end with two slashes. So it's "C:\Stuff\MyMod\\" <-- note the double slash. This is because otherwise Visual Studio will think that the final quote is a part of the name.
  • In the "Debug" tab:
    • In the "Configuration" drop-down, select "All configurations", again.
    • In the "Platform" drop-down, select "Active (x86)", again.
    • Under "Start Action" sekect "Start external program", and set it to the tDev.exe file, located in your main game folder.

That should be all. Hope this helps! ;)
[DOUBLEPOST=1423965553][/DOUBLEPOST]BTW, I'm making a simple tool to automate all this and generate a simple project for you. ;)


Looks awesome. This is probably false, but is it compatible with tAPI? And can you run other people's mods with it?


It is! Basically tDev is generated from tAPI binaries, so when in doubt, just remember:
tDev = tAPI + a few patches for debugging + tDev.Build

As for running other people's mods - yeah, sure, why not? Just drop them in the tDev mod folder, and remember that tDev has its own mod folder. ;)
[DOUBLEPOST=1424072823][/DOUBLEPOST]PS: A few hours more and I'll have a Visual Studio project generator (codename: Tempo) ready for y'all. That should make the entry bar even lower. :D I would've had it already, but WPF is a :red:.
Last edited:


Mind hitting me up when you have the simplified version? The simpler the better as I have a very limited grasp when it comes to these things. XD
I'm barely even starting, and the last game I learned to mod was Diablo 2. All written in a unique variant of C++...


Skeletron Prime
This looks fantastic! I am very interested in using it but.... Do I have to use visual basic to edit while in game?
Awesome! Having to rebuild every time I tweaked a tiny thing was a hassle, what are the limitations of it? Will it allow major code changes, such as new classes, or will stuff like that require a restart? Either way this will make everyone's life much easier, awesome job!

Chicken Bones

Excellent tool. Any chance of a tDev for server?

Edit: I used the source and made one that works for my debugging purposes.
Last edited:


Skeletron Prime
When I press start on Visual Studio, tDEV says "No Mod selected to build. Required elements : <Mod Name>, <Mod Path>." I made sure to follow all the directions and everything should be correct, however it still doesn't seem to work.
Top Bottom