Skip to content

[Tutorial] 2. Hooking Chat

Deathly edited this page Jun 1, 2011 · 2 revisions

Tools

  • Terraria Source
  • ModClass

Adding the hook

  • Open Main.cs
  • Navigate to if (inputTextEnter && chatRelease) [Line 8865]
  • Replace if (Main.chatText != "") with if (Main.chatText != "" && ModClass.onChat(Main.chatText))
  • Open ModClass.cs
  • Add the following function public static boolean onChat(String text) { return true; }

Using the hook

  • Open ModClass.cs
  • Add your Conditions into the public static boolean onChat(String text)-Method
  • return true; to send the message, return false; to keep it

Clone this wiki locally