tModLoader Can modify vanilla content with TModloader?

megagoldgolem

Terrarian
Hello anyone, i have a question: Can i modify vanilla content (like npc ai, damage, defence, projectile, etc. of items, etc) With TModloader?
Please, if you have an answer, write it here.
(Sorry for bad english, i'm don't know it very well.)
 
Yes, you can. :)

To edit vanilla content, you need to implement several specific classes (the "Global " classes). There, you can change any vanilla projectile, item or NPC.
 
Last edited:
Yes, you can.

To edit vanilla content, you need to implement several specific classes (the "Global " classes). There, you can change any vanilla projectile, item or NPC.
Thank you very much, but sorry, can you write here an example of it? I am new at modding
 
Thank you very much, but sorry, can you write here an example of it? I am new at modding
C#:
public class StrongerSlime : GlobalNPC
{
    public override void ModifyHitPlayer(NPC npc, Player target, ref int damage, ref bool crit)
    {
        if (npc.type == NPCID.GreenSlime)
        {
            damage *= 2;
        }
    }
}

Here's a simple example. This code doubles the hit damage whenever the player is attacked by a Green Slime. This is but one example, there are many ways to change vanilla behaviour, some more difficult than others.
 
Back
Top Bottom