• For issues you find with the Switch and Console releases, please follow this link and give as much detail as possible. This is the speediest way to get info to Pipeworks and get a hotfix in the works.
  • 1.4 will bring many changes to the PC version. We strongly advise making plans to back up your worlds and players prior to updating your game. More details here.
  • Begin your search for Journey's End information here and here. Please report bugs and issues for Journey's End here.
  • For issues you find with the Mobile 1.3 update, please follow this link and give as much detail as possible. This is the speediest way to get info to DR Studios to look at your issue. Also, some troubleshooting hints here.

tModLoader Help with custom crown vanity item

Fabu ♡

Terrarian
So I've added a custom crown vanity item to my mod, but when it's worn it removes all the hair from the player, which I don't want.
I've used "item.headSlot = 26;" in the script, but now it makes it look like a golden crown when the player wears the custom crown.
How do I change the texture of the golden crown to my custom one? Or how do I make the player wear the custom crown with his hair sticking out on the back?

Here's the code:

Code:
using Terraria;
using Terraria.ModLoader;
using Terraria.ID;

namespace FabusMod.Items.Armor
{
    [AutoloadEquip(EquipType.Head)]
    public class ClysmCrown : ModItem
    {
        public override void SetStaticDefaults()
        {
            DisplayName.SetDefault("Clysm Crown");
        }

        public override void SetDefaults()
        {
            item.width = 20;
            item.height = 12;
            item.maxStack = 99;
            item.value = Item.sellPrice(0, 2, 0, 0);
            item.headSlot = 26;
            item.rare = 1;
            item.vanity = true;
        }
     
        public override bool DrawHead()
        {
            return true;
        }
     
    }
}
Thanks for your help!
 

East

Skeletron
So I've added a custom crown vanity item to my mod, but when it's worn it removes all the hair from the player, which I don't want.
I've used "item.headSlot = 26;" in the script, but now it makes it look like a golden crown when the player wears the custom crown.
How do I change the texture of the golden crown to my custom one? Or how do I make the player wear the custom crown with his hair sticking out on the back?

Here's the code:

Code:
using Terraria;
using Terraria.ModLoader;
using Terraria.ID;

namespace FabusMod.Items.Armor
{
    [AutoloadEquip(EquipType.Head)]
    public class ClysmCrown : ModItem
    {
        public override void SetStaticDefaults()
        {
            DisplayName.SetDefault("Clysm Crown");
        }

        public override void SetDefaults()
        {
            item.width = 20;
            item.height = 12;
            item.maxStack = 99;
            item.value = Item.sellPrice(0, 2, 0, 0);
            item.headSlot = 26;
            item.rare = 1;
            item.vanity = true;
        }
   
        public override bool DrawHead()
        {
            return true;
        }
   
    }
}
Thanks for your help!
Code:
public override void DrawHair(ref bool drawHair, ref bool drawAltHair)
        {
            drawHair = true;  //player make so the player hair does not show when the vanity mask is equipped.  add true if you want to show the player hair.
        }
That'll do
 

Fabu ♡

Terrarian
Code:
public override void DrawHair(ref bool drawHair, ref bool drawAltHair)
        {
            drawHair = true;  //player make so the player hair does not show when the vanity mask is equipped.  add true if you want to show the player hair.
        }
That'll do
Thank you!
 
Top Bottom