Open Source Mods - tModLoader/tModLoader GitHub Wiki

The following is a list of Open Source Mods (not all are technically "Open Source" in the traditional sense, by the way.). These mods' sources are available for a variety of reasons, mostly to facilitate and encourage community contributions, but we have listed them here for two reasons.

  1. The first reason is that modding is difficult, and learning how to do everything by oneself can prove hard. Joining an existing mod is a great way to quickly see your ideas come to life without having to know everything about Terraria modding. If you are interested in contributing to one of these mods, feel free to fork the mod, make your changes, and then submit a pull request to the main branch. Once you have gained the trust of the mod owner, you may be allowed into the team and given direct access to the mod. Please note that not all open source mods desire random contributions. Try to get a feel for what the mod needs, either by noticing bug reports on their Issue tracker or on their homepage. You can also look for TODO notes in the code or noted elsewhere for ideas of things to implement. If you are contributing art or sounds, it might be a good idea to communicate with the mod owner as well to get art direction before you waste your efforts on something that wasn't desired. If in doubt, contact the mod owner on the Terraria Community Forums.

  2. The second reason we have listed these mods is because there are still a lot of things the tutorials and ExampleMod do not cover. Search these mods and look for code that might help you. Remember, just because a Mod is Open Source, that doesn't mean you can copy all the code and call it your own. Read the licence the code is licenced under for details. For the most part, however, you should be using Open Source mods as a guide for learning how to structure your mod. (You'll be shunned in the modding community if your mod is just a copy/paste conglomeration of other mods' code.)

Remember, you can't just copy code from these mods unless the licence they are under specifically allows it. If there is no licence, the owner reserves all ownership and copyright of the code, so you need to contact the owner and ask permission to utilize certain parts. Don't worry, most will be happy to allow you to use portions of their code, but you still need to ask.

Content Mods

These mods are mods that add common things such as items, enemies, furniture, pets and so forth.

  • All The Walls -- A good example of NOT using Autoload. Learn from this mod how to programmatically add items to write clean code.
  • Antiaris Mod -- Adds several generated structures, quest system and other content, including bosses, enemies & items.
  • Calamity Vanities -- This mod aims to add more vanity items/pets to the Calamity mod. This is a great example of adding new more complex pets.
  • Cave Story -- Adds a bit of everything.
  • Clicker Class -- Adds a custom class and associated items. Comes with armor glowmasks, custom mod.Call API including an example mod, and translation/localization support.
  • Dragon Ball Terraria -- Adds a custom energy system with some UI elements, a custom damage type, quite a few unique weapons and transformational effects.
  • Elemental Unleash Mod -- Good resource for learning how to code Boss AI
  • Enigma -- Adds a new level-up system, a few bosses, weapons, and accessories.
  • Example Mod -- Offers a wide variety of code examples covering Beginner to Expert.
  • Fargo's Soul Mod -- A new mode that overrides vanilla boss AI
  • Kalciphoz's RPG Mod -- This mod aims to overhaul Terraria by adding RPG elements, and includes a leveling system, an item upgrade system, an elemental damage system, procedurally generated weapons, and much more. For more detailed information, see the wiki
  • Magic Storage -- A lot of UI, inheritance, and networking.
  • Miscellania -- Small content mod with a bit of everything.
  • Orchid Mod -- A big content mod which adds multiple new damage classes and one full damage class.
  • The Celestial Overtaking -- Adds a lot of almost everything.
  • Qwerty's Bosses and Items -- Adds a lot of interesting things. Has a lot uses of custom npc AIs (including bosses), an invasion, custom minion/sentry AIs, player layers and more.
  • Spirit Mod -- Large content mod with alot of worldgen, and custom visuals utilizing primitive drawing.
  • Starflower -- Adds a herb that spawns on sky islands, a planter box to go with it, and three potions crafted from it.
  • Summoners Association -- Projectile and Minion related code. Uses TerrariaHooks' detours (On.) to simulate a minion target.
  • Team Fortress 2 -- Heavy emphasis on weapons. Adds a reloading system, healing weapons, and an ability for NPCs to scale their health and damage based on the player.
  • The Amulet Of Many Minions -- Adds new minions and associated items, aswell as a "squire" summoner subclass. Heavy utilization of inheritance, and has custom networking/netcode.
  • The Luggage -- A pet that collects loot for you.
  • WeaponOut -- Complicated items, custom graphics, config file system with JSON.
  • ZoaklenMod -- Adds a bunch of different weapons and armor.

Other Mods

These mods cover everything except mods that are primarily about new content. Some change mechanics, others make quality of life changes, others do random things. These mods may be a bit harder to contribute to due to their nature.

  • Terraria Overhaul -- Hundreds of mechanics implemented in readable and scalable code. Also serves as a good reference on advanced concepts such as injections, data-driven content, video playback, lighting buffers, scalable GUI, "event recording", etc.
  • AutoTrash -- UI, a slot that auto trashes items you pick up.
  • Bangarang - A Boomerang Overhaul -- Adds boomerang style projectiles using a Boomerang abstract class
  • Boss Checklist -- UI, weak mod references, and using Call for cross-mod communication.
  • Bouncy Coins -- Makes coins bounce (also showcases weak dependency support with FK's Mod Settings Configurator).
  • Craftable Treasure Bags -- Many examples of cross mod recipes and use of recipe groups.
  • Craftable Lunar Tools -- Makes normally unobtainable lunar tools craftable.
  • Dye Easy -- Automatically editing recipes in complicated ways (without using RecipeEditor).
  • Eternal Mods -- Tile Entities, UI and a bunch of framework stuff.
  • Even More Modifiers -- A mod to add custom effects to the game that can affect weapons, accessories and armors. Showcases hacking armor items to allow them to be reforged as accessories, UI, a solid open-ended framework designed so other mods can add their own content to its system, documentation, abstraction and design practices, MP compatibility, glowmasks and shaders, optional hard-references (support with other mods) and various uses for Attribute classes.
  • Fast Start -- Start the game with a bit more gear than usual.
  • hamstar's mods -- A set of 11 open source mods adding significant original gameplay elements or minor content additions.
  • HEROs Mod -- A lot of networking code. (Do not consult for UI)
  • Item Checklist -- UI, TagCompound, saving Items in TagCompounds.
  • Item Customizer -- Messing with shaders.
  • Modders Toolkit -- A lot of UI. Very useful in-game to visualize the effects of code as well. In-game c# interpreter also very useful.
  • Quality of Terraria -- All the basic and advanced modding: UI, shader, save and load data, multiplayer, On, IL, localization and a lot more.
  • Shader Lib -- Messing with shaders.
  • Shorter Respawn -- Integrating with other mods through Call. (Cheat Sheet and HEROs Mod).
  • Terraria Sound Suite -- Everything Terraria sounds: Lets see sounds, their exact values, etc. without needing to search in the source code. You can also select any sound you want and play it in its extensive config. Uses TerrariaHooks' detours (On.) and reflection.
  • The Deconstructor -- Deconstruct any item back into its recipe (showcases custom UI, sound effects and more).
  • Vanilla Tweaks -- Various tweaks using GlobalItem, GlobalNPC etc, recipe editing, options system with JSON.
  • Wireless -- Wiring related code, storing custom tile information using ModSystem.

Too Advanced/Specific

These mods are probably too specific or advanced to for most modders.

  • Alternate Dimensions -- An incomplete implementation of alternate dimensions. Knowledgeable and determined modders are encouraged to discuss a suitable implementation.
  • Boss Expertise -- Various Expert Mode related "hacks", options system with JSON, integration with Cheat Sheet.
  • CLib -- Rewriting the update methods for all entities, loads of static method tools that you can use to save some time typing. Adds a drawtext equivalent data structure to drawdata. Has some rewritten collision detection and some custom. Tries to aid TMod the best it can. Always accepting help.
  • Emoji Support -- Add a Chat Tag Handler
  • WorldGenPreviewer -- Hijacking the WorldGen screen, Reflection.