tModLoader Problems with an error

Geotree

Skeletron
I keep getting this error "Terraria.ModLoader.Mod.GetTexture(String name)"
I've checked and I've done everything right, namespace is correct, class is "Sword", filename is "Sword.cs", image name is "Sword.png" what else am I missing?


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

namespace TerrariaBS.Weapons
{
    public class Sword : ModItem
    {
        public override void SetStaticDefaults()
        {
            Tooltip.SetDefault("salutations");
        }

        public override void SetDefaults()
        {
           
            item.knockBack = 69f;
            item.damage = 69;
            item.useStyle = 1;
            item.useAnimation = 30;
            item.useTime = 30;
            item.width = 16;
            item.height = 20;
            item.UseSound = SoundID.Item1;
            item.autoReuse = false;
            item.noUseGraphic = true;
            item.noMelee = true;
            item.crit = 6;
            item.rare = 5;
            item.value = 69000000;
        }
    }
}
 
Last edited:
I keep getting this error "Terraria.ModLoader.Mod.GetTexture(String name)"
I've checked and I've done everything right, namespace is correct, class is "Sword", filename is "Sword.cs", image name is "Sword.cs" what else am I missing?

Your image name shouldn't be "Sword.cs". It should just be "Sword.png"
 
Can you post a screenshot of the folder that the code / PNG is in? Nothing looks wrong with the code itself.
2022-03-06 (10).png

both of the files are in the same folder
 
Ah so the issue I see is that you have everything installed on OneDrive rather than locally. OneDrive can cause all types of syncing issues and things like this to happen. I highly recommend not using it, but you'd need to uninstall / reinstall tmodloader and have everything local.
 
Back
Top Bottom