tModLoader Documentation
repository·1.4.5·Indexed 25 days ago
https://github.com/tmodloader/tmodloaderAn open-source, community-driven modification API for Terraria that enables players to create, install, and play mods in single-player and multiplayer. The documentation covers modding implementation details such as custom visual EquipTypes, ModTypes, and VictoryPoses, as well as the ExampleMod reference project. It also includes technical details on the tModLoader CLI for decompiling, patching, and regenerating source code.
What's inside tModLoader
- To install tModLoader using Steam, search for 'tModLoader' in the Steam Store and proceed with the standard installation process.
Implement a custom visual EquipType
1.4.5A visual EquipType allows multiple items to share a single
PlayerDrawLayerat a specific position on the player character. This prevents textures from layering incorrectly (e.g., rendering multiple sets of boots simultaneously) by ensuring only the latest visible item of that type is rendered.To implement a complete custom visual EquipType, you need the following components:
- A Loader Class (e.g.,
EarringsLoader): Manages loading and tracking equipment textures for the custom type. - A GlobalItem Class (e.g.,
EarringsGlobalItem): Detects when items are equipped and passes their data (including dye/shader info) to the player class. - A Player Class (e.g.,
EarringsPlayer): Stores the state of which specific equipment is currently active and its visual modifiers. - A PlayerDrawLayer Class (e.g.,
EarringsDrawLayer): Inherits fromPlayerDrawLayerto handle the actual rendering logic. - An Autoload Attribute (e.g.,
AutoloadEquip_EarringAttribute): An attribute applied toModItemclasses to automatically register their textures for the custom EquipType.
- A Loader Class (e.g.,
Use ExampleMod to learn tModLoader modding
1.4.5TheExampleModrepository contains source code designed to teach modders how to implement various types of content in Terraria. It is recommended to useExampleModas a reference after completing the Basic tModLoader Modding Guide. You can explore specific implementations, such as weapons, by navigating to theContent/Items/Weaponsdirectory in the source tree.Play Terraria mods as a player
1.4.5If you want to install and play existing mods, follow the player-specific guide: https://github.com/tModLoader/tModLoader/wiki/tModLoader-guide-for-players.
Note: To play multiplayer with friends using mods, all participants must have tModLoader installed. Vanilla Terraria users cannot play with tModLoader users.
Upload content to the TML Mod Browser
1.4.5Mod creators can upload content to the TML Mod Browser using Steam's verification system. By uploading, you agree to the following:
- The TML Team has the right to alter, modify, or remove any uploaded content at their discretion.
- Successful upload messages do not guarantee the content is available or that the upload was truly successful.
- You may not upload material that infringes on any copyright, patent, trademark, or other proprietary rights.
- You may remove your own uploaded content, but this does not guarantee removal from other channels where it may have propagated.
- Content creators cannot force the removal of content that users have already downloaded through the TML Software or Mod Browser.
- Access to the Mod Browser service may be permanently denied to any individual without the right to appeal.
Verify tModLoader installation
1.4.5Launch thetModLoaderfile (located attModLoader.app/Contents/MacOS/tModLoader) or launch through Steam. You have successfully installed tModLoader if you seeModsorMod Browseroptions on the main Terraria menu.Set up a dedicated tModLoader server on macOS
1.4.5To run a dedicated tModLoader server, you must first install the un-modded Terraria server (available at http://terraria.org/server/terraria-server-1353.zip). Once the base server is installed, follow the manual installation instructions to copy the tModLoader files into the directory where you installed the Terraria server. For detailed command-line instructions, refer to the tModLoader Dedicated Host guide.Install tModLoader via Steam
1.4.5The easiest way to get tModLoader is through Steam. You can find the official product page here: https://store.steampowered.com/app/1281930/tModLoader/Use the Terraria trademark in Mod promotional materials
1.4.5When creating or promoting a Mod, you may use the
Terrariatrademark only in a referential way to indicate compatibility. You must adhere to these constraints:- Use referential phrases like
for use withorcompatible with. - Do not include
Terrariaas part of the Mod's name. - Ensure the word
Terrariaappears less prominent than the Mod name. - The reference must not imply endorsement, sponsorship, or a false association with Re-Logic, Inc.
- Do not use the trademark in a way that shows Re-Logic, Inc. or the Terraria game in a false or derogatory light.
- Use referential phrases like
Contribute to tModLoader
1.4.5To help improve the tModLoader API and engine, follow the contributor guide: https://github.com/tModLoader/tModLoader/wiki/tModLoader-guide-for-contributorsDownload and install ExampleMod for local experimentation
1.4.5You can download
ExampleModto your local machine to experiment with the code or build it in-game.- Download the
stable.ziparchive. - Extract the
ExampleModfolder. - Place the
ExampleModfolder into yourModSourcesfolder (located within your tModLoadersavesfolder).
Once placed in
ModSources, you can buildExampleModin-game just like any other mod.https://github.com/tModLoader/tModLoader/archive/refs/heads/stable.zip- Download the
Uninstall tModLoader
1.4.5To remove tModLoader:
- Steam users: Right-click
tModLoaderin your Steam Library ->manage->uninstall. - Manual users: Simply delete the
tModLoaderfolder you created.
Warning: You cannot use tModLoader to play un-modded Terraria or join un-modded Terraria servers. To do so, you must use the standard Terraria installation.
- Steam users: Right-click