tModLoader Tutorial: [1] Getting started with tModLoader

Code:
using Terraria.ID;
using Terraria.ModLoader;
namespace Acceptance.Items
{
    public class Sumarbrander : ModItem
    {
        public override void SetStaticDefaults()
        {
            DisplayName.SetDefault("Sumarbrander");
            Tooltip.SetDefault("A little talktive...");
        }
        public override void SetDefaults()
        {
            item.damage = 59;
            item.melee = true;
            item.width = 1;
            item.height = 1;
            item.useTime = 18;
            item.useAnimation = 18;
            item.useStyle = 1;
            item.knockBack = 6;
            item.value = 10001;
            item.rare = 3;
            item.UseSound = SoundID.Item4;
            item.autoReuse = true;
        }
            public override void AddRecipes();
      
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.HellstoneBar, 10);
            recipe.AddTile(TileID.WorkBenches);
            recipe.SetResult(this);
            recipe.AddRecipe();
      
        }
    }
}

so... does anyone know what is wrong with this? im making a custom item called Sumarbrander and cant figure out whats wrong.
 
Code:
using Terraria.ID;
using Terraria.ModLoader;
namespace Acceptance.Items
{
    public class Sumarbrander : ModItem
    {
        public override void SetStaticDefaults()
        {
            DisplayName.SetDefault("Sumarbrander");
            Tooltip.SetDefault("A little talktive...");
        }
        public override void SetDefaults()
        {
            item.damage = 59;
            item.melee = true;
            item.width = 1;
            item.height = 1;
            item.useTime = 18;
            item.useAnimation = 18;
            item.useStyle = 1;
            item.knockBack = 6;
            item.value = 10001;
            item.rare = 3;
            item.UseSound = SoundID.Item4;
            item.autoReuse = true;
        }
            public override void AddRecipes();
    
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.HellstoneBar, 10);
            recipe.AddTile(TileID.WorkBenches);
            recipe.SetResult(this);
            recipe.AddRecipe();
    
        }
    }
}

so... does anyone know what is wrong with this? im making a custom item called Sumarbrander and cant figure out whats wrong.
usually you'd want to include the error message.

Luckily I noticed this semicolon that you need to delete and replace with { : public override void AddRecipes();
 
Hi... Ummm... This...
221086-e9ef49a2a922bc4867ffb6f41b13769a.jpg

This is my first mod, FYI.
 

Attachments

  • Screen Shot 2019-05-07 at 5.06.56 PM.png
    Screen Shot 2019-05-07 at 5.06.56 PM.png
    1.1 MB · Views: 298
The ModLoader folder is not shown in my Terraria files. I did get Tmodloader and it has been working properly on my Terraria game, but I did move the Terraria files from %UserProfile%/Documents/My Games. Could this be causing the folder to show up somewhere else?
 
Help! when i type item.damage = 50 it says that it doesn't exist in the current context.I dont know how to fix this thank you to anyone who helps me.
 
There is no Mod Sources folder OR BUTTON ON THE TITLE SCREEN??? WHAT HAPPENED TO IT???
If you've had an installation prior to 1.4, it might not appear after updating. You can either re-install tModLoader manually or download it from Steam.
Also make sure you're using the correct executable for tModLoader.
 
Hi, I'm trying to create a test sword, but I keep on getting this error:
Screenshot from 2020-07-08 19-39-55.png

I saw someone else on this thread with the same problem, but they had a double directory if I understood correctly.
My ~/.../Mod Sources/modOfLagomorphaexe has the .cs, .csproj, build.txt, description.txt, and the Properties folder with the launch settings. I made a seperate Items folder (in /modOfLagomorphaexe) containing the Cyberbunnysword.png and Cyberbunnysword.cs files, as no test sword was included in the skeleton.

This error only happens after I try loading the mod itself; the compiling works fine. My code is basically exactly the same from a working example.
 
what does it mean because I want to change the crafting station from Workbenches to Iron Anvil
 

Attachments

  • 20210221204519_1.jpg
    20210221204519_1.jpg
    174.3 KB · Views: 73
Back
Top Bottom