tModLoader Is there a way to change a vanilla item's tooltip?

Halocaster

Official Terrarian
I've been figuring out how to change the Gold and Platinum pickaxes' tooltips, but I can't figure how.
I tried implementing a "GlobalItem" class but I do not know how to change the tooltips.
Can somebody help me? '-'
 
actually yes
this is code from my mod to change item desc.
Code:
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System.Collections.Generic;
using System;
using Terraria.DataStructures;
using Terraria.Localization;
using System.IO;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using System.Linq;

namespace yourmodname
{
    public class yourItemName : GlobalItem
    {
        public override void ModifyTooltips(Item item, List<TooltipLine> tooltips)
        {
            if (item.type == ItemID.yourItemName)
            {
                //remove the tooltip
             //   tooltips.RemoveAll(x => x.Name == "Tooltip0" && x.mod == "Terraria");
                //actually, the hood's old statics is increased damage and crit chance by 10%.
             
                TooltipLine line = tooltips.FirstOrDefault(x => x.Name == "Tooltip0" && x.mod == "Terraria");
                if (line != null)
                {
                    line.text = "10% increased magic damage and critical strike chance.";
                }
             
            }
        }

        public override void UpdateEquip(Item item, Player player)
        {
            if (item.type == ItemID.yourItemName)
            {
    //here you add stats

            }
        }
    }
}

hope it helps
 
actually yes
this is code from my mod to change item desc.
Code:
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System.Collections.Generic;
using System;
using Terraria.DataStructures;
using Terraria.Localization;
using System.IO;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using System.Linq;

namespace yourmodname
{
    public class yourItemName : GlobalItem
    {
        public override void ModifyTooltips(Item item, List<TooltipLine> tooltips)
        {
            if (item.type == ItemID.yourItemName)
            {
                //remove the tooltip
             //   tooltips.RemoveAll(x => x.Name == "Tooltip0" && x.mod == "Terraria");
                //actually, the hood's old statics is increased damage and crit chance by 10%.
            
                TooltipLine line = tooltips.FirstOrDefault(x => x.Name == "Tooltip0" && x.mod == "Terraria");
                if (line != null)
                {
                    line.text = "10% increased magic damage and critical strike chance.";
                }
            
            }
        }

        public override void UpdateEquip(Item item, Player player)
        {
            if (item.type == ItemID.yourItemName)
            {
    //here you add stats

            }
        }
    }
}

hope it helps
Thank you!
 
Back
Top Bottom