Skip to content

loadsec/Terraria-Patcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

248 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terraria Mod Menu

A modern desktop mod menu platform for Terraria Vanilla and tModLoader. Control official runtime modules, apply IL-level game modifications, manage external plugins, and fine-tune your setup from a single Windows/Linux interface.

Release Downloads Platform Patching Terraria License: MIT


Screenshots

Home Home

Patcher Patcher

Plugins.ini Editor Plugins.ini Editor


Platform Support

Feature Windows Linux macOS
App runs Yes Yes Not validated
Terraria Vanilla Mod Menu Yes Yes Not validated
tModLoader Mod Menu Yes Yes Not validated
Plugin system Yes Yes Not validated
Mod Menu JSON editor Yes Yes Not validated
Auto-updates Yes Yes Not validated

macOS status — macOS has not been validated yet. The app may install or open there, but patching and runtime behavior may not work properly until tested on real macOS Terraria installs.


Features

Game Modifications

Patches are applied directly to the Terraria Vanilla executable or to tModLoader.dll via IL injection using Mono.Cecil. A backup is created before every patch so you can restore at any time.

Category Available Patches
Quality of Life Display Clock, Functional Social Slots, Max Crafting Range, Pylons Everywhere, Remove Angler Daily Limit
Combat & Debuffs Remove Rod of Discord Debuff, Remove Potion Sickness, Remove Mana Costs, Remove Drowning Damage
Overpowered / Cheats One Hit Kill, Infinite Ammo, Infinite Wings, Infinite Cloud Jumps
Persistent Buffs Permanently activate any in-game buff
Healing Rates Tune Vampire Knives & Spectre Armor life steal percentages
Spawn Tweaks Adjust Voodoo Demon spawn rate
Loot & Bags Force Treasure Bags to always drop every possible item

Plugin System

  • Browse and enable community plugins from a dedicated interface
  • Individual enable/disable control per plugin
  • Auto-sync: plugin files and the PluginLoader are written to your Terraria directory automatically when enabled
  • Supports Windows and Linux Terraria builds
  • Includes dedicated surfaces for Terraria Vanilla and tModLoader

Plugins.ini Editor

A typed, in-app editor for the Plugins.ini configuration file generated by the plugin loader. Supports boolean, number, text, and hotkey field types with save and per-key delete actions.

Configuration & Updates

  • Set and validate your Terraria executable path
  • Language selector with search (English / Português Brasileiro)
  • Automatic language detection on first launch
  • Built-in update checker with background download support (via electron-updater)
  • .NET runtime prerequisite detection with direct download links

Tech Stack

Layer Technology
Desktop runtime Electron
UI framework React 19 + TypeScript
Build tooling electron-vite + Vite
Styling Tailwind CSS v4 + shadcn/ui
Routing react-router-dom
i18n react-i18next
Settings persistence electron-store
Auto-updates electron-updater
Patching bridge .NET 10 C# subprocess (stdin/stdout JSON-RPC)
IL manipulation Mono.Cecil

Architecture

React UI (renderer process)
  └─ window.api.* — IPC exposed via preload
       └─ Electron main process (src/main/index.ts)
            └─ C# bridge subprocess — JSON over stdin/stdout
                 └─ Mono.Cecil → patches Terraria.exe on disk

The C# bridge is a self-contained .NET 10 binary bundled with the app. The main process spawns it on demand, sends JSON commands, and reads JSON responses — no native Node addons required.


Getting Started

Prerequisites

Requirement Version Notes
Node.js ≥ 18
pnpm ≥ 8 npm install -g pnpm
.NET 10 Runtime ≥ 10.0 Required for patching. Download
.NET 10 SDK ≥ 10.0 Only needed if you want to build the C# bridge from source

Clone & Install

git clone https://github.com/loadsec/Terraria-Patcher.git
cd Terraria-Patcher
pnpm install

Run in Development

pnpm dev

On Linux, if you encounter sandbox issues inside a VM or container, use:

pnpm dev -- --no-sandbox

Build for Distribution

pnpm build           # Current platform
pnpm build:win       # Windows — NSIS installer
pnpm build:linux     # Linux — AppImage
pnpm build:mac       # macOS — DMG (not validated; patching may not work properly)

Building the C# Bridge

The patching logic lives in src/main/bridge/ and compiles to a self-contained binary placed in resources/patcher-bridge/.

Prebuilt binaries are included in the repository so you can run the app without compiling the bridge yourself. Only rebuild if you change the C# source.

# Rebuild the bridge for the current platform
pnpm build:bridge

# Or manually:
cd src/main/bridge
dotnet build -c Release

Plugin Loaders

The plugin loader is a small assembly injected into Terraria's directory to enable runtime C# plugin loading. There are two variants:

Variant Target Build Command
XNA Windows (Steam/XNA) Included prebuilt
FNA Linux/macOS (Steam Runtime / FNA) pnpm build:plugin-loader-fna

To build the FNA variant, point FNA_LIB_DIR at your Terraria managed files folder (must contain FNA.dll and Terraria.exe):

export FNA_LIB_DIR="/path/to/Terraria"
pnpm build:plugin-loader-fna

Runtime .cs plugin compilation on Linux FNA builds requires mono-devel (sudo apt install mono-devel).


Project Structure

Terraria-Patcher/
├── src/
│   ├── main/                    # Electron main process + all IPC handlers
│   │   └── bridge/              # C# patching bridge (.NET 10, Mono.Cecil)
│   ├── preload/                 # Context bridge (window.api)
│   └── renderer/src/
│       ├── pages/               # App pages
│       ├── components/          # Shared UI components
│       ├── locales/             # i18n files (en, pt-BR)
│       └── i18n.ts
├── resources/
│   ├── patcher-bridge/          # Prebuilt C# bridge binaries (win/linux/mac)
│   └── plugins/                 # Prebuilt plugin loader assemblies
└── version.json                 # App version + Terraria target + release manifest

Inspiration & Credits

This project is heavily inspired by the original Terraria Patcher by Doug Benham — the developer who first demonstrated how to apply IL patches to Terraria on Windows using Mono.Cecil. His work laid the entire foundation this tool builds upon.

Our goal is to extend that foundation with a modern Windows/Linux interface, support for Terraria Vanilla and tModLoader, a plugin management system, and an open, community-driven approach to Terraria modding.


Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you'd like to change.

If you have access to a macOS machine with Terraria installed and want to validate macOS behavior, please open an issue — that contribution would be very welcome.


License

Released under the MIT License.


Made with ❤️ for the Terraria community