Need help writing a mod for 1.4

tgg123

Terrarian
Hi, I'm trying to start making basic mods in tmodloader for 1.4, but can't seem to create new items. I was wondering how things have changed since ExampleMod was created. I took ExampleSword and stripped the dependencies on other files from that repo, but I keep getting error CS0103: The name 'item' does not exist in the current context when I build the mod in game. I've tried reading through the tmodloader docs for 1.4 alpha but haven't had any luck with this.
I've just initiated a mod in the tmodloader menus and added this file in Items/Weapons
Code:
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace ExampleMod.Items.Weapons
{
    public class ExampleSword : ModItem
    {
        public override void SetStaticDefaults() {
            Tooltip.SetDefault("This is a modded sword.");
        }

        public override void SetDefaults() {
            item.damage = 50;
            item.melee = true;
            item.width = 40;
            item.height = 40;
            item.useTime = 20;
            item.useAnimation = 20;
            item.knockBack = 6;
            item.value = Item.buyPrice(gold: 1);
            item.rare = ItemRarityID.Green;
            item.UseSound = SoundID.Item1;
            item.crit = 6;
            item.useStyle = ItemUseStyleID.SwingThrow;
        }
    }
}
 
Last edited:
Never mind. I now see there's a 1.4 branch for ExampleMod. I would delete this post, but I don't know how
 
I would delete this post, but I don't know how
Threads aren't normally deleted on the forums, but if you don't need this anymore, you can report the thread and ask for it to be locked.
 
Back
Top Bottom