Standalone [1.3] tModLoader - A Modding API

make sure you wrote the sprite name right in the code and if its in the right folder
Is this right that you can see?
Code:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;

namespace Randomness.Items.Weapons
{
    public class ExampleHammer : ModItem
    {
        public override void SetDefaults()
        {
            item.name = "Example Hammer";
            item.damage = 100;
            item.melee = true;
            item.width = 90;
            item.height = 90;
            item.toolTip = "This is a modded Hammer";
            item.useTime = 25;
            item.useAnimation = 25;
            item.useStyle = 1;
            item.knockBack = 20;
            item.value = 100;
            item.rare = 10;
            item.useSound = 1;
            item.autoReuse = true;
            item.useTurn = true;
        }
        public override void AddRecipes()
        {
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.DirtBlock, 1);
            recipe.AddTile(TileID.WorkBenches);
            recipe.SetResult(this);
            recipe.AddRecipe();

        }
    }
}
 
Is this right that you can see?
Code:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;

namespace Randomness.Items.Weapons
{
    public class ExampleHammer : ModItem
    {
        public override void SetDefaults()
        {
            item.name = "Example Hammer";
            item.damage = 100;
            item.melee = true;
            item.width = 90;
            item.height = 90;
            item.toolTip = "This is a modded Hammer";
            item.useTime = 25;
            item.useAnimation = 25;
            item.useStyle = 1;
            item.knockBack = 20;
            item.value = 100;
            item.rare = 10;
            item.useSound = 1;
            item.autoReuse = true;
            item.useTurn = true;
        }
        public override void AddRecipes()
        {
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.DirtBlock, 1);
            recipe.AddTile(TileID.WorkBenches);
            recipe.SetResult(this);
            recipe.AddRecipe();

        }
    }
}
it looks fine but check if you wrote the sprites name which is here namespace Randomness.Items.Weapons
 
no the sprite name has to be the same as here
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;

namespace Randomness.Items.Weapons
{
public class ExampleHammer : ModItem
{
public override void SetDefaults()
{
item.name = "Example Hammer";
item.damage = 100;
item.melee = true;
item.width = 90;
item.height = 90;
item.toolTip = "This is a modded Hammer";
item.useTime = 25;
item.useAnimation = 25;
item.useStyle = 1;
item.knockBack = 20;
item.value = 100;
item.rare = 10;
item.useSound = 1;
item.autoReuse = true;
item.useTurn = true;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.DirtBlock, 1);
recipe.AddTile(TileID.WorkBenches);
recipe.SetResult(this);
recipe.AddRecipe();

}
}
}
[doublepost=1462399733,1462399674][/doublepost]sorry I meant ExampleHammer its has to be called ExampleHammer
 
no the sprite name has to be the same as here
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;

namespace Randomness.Items.Weapons
{
public class ExampleHammer : ModItem
{
public override void SetDefaults()
{
item.name = "Example Hammer";
item.damage = 100;
item.melee = true;
item.width = 90;
item.height = 90;
item.toolTip = "This is a modded Hammer";
item.useTime = 25;
item.useAnimation = 25;
item.useStyle = 1;
item.knockBack = 20;
item.value = 100;
item.rare = 10;
item.useSound = 1;
item.autoReuse = true;
item.useTurn = true;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.DirtBlock, 1);
recipe.AddTile(TileID.WorkBenches);
recipe.SetResult(this);
recipe.AddRecipe();

}
}
}
[doublepost=1462399733,1462399674][/doublepost]sorry I meant ExampleHammer its has to be called ExampleHammer
oh
 
so it should be like this?
Code:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;

namespace ExampleHammer.Items.Weapons
{
    public class ExampleHammer : ModItem
    {
        public override void SetDefaults()
        {
            item.name = "Example Hammer";
            item.damage = 100;
            item.melee = true;
            item.width = 90;
            item.height = 90;
            item.toolTip = "This is a modded Hammer";
            item.useTime = 25;
            item.useAnimation = 25;
            item.useStyle = 1;
            item.knockBack = 20;
            item.value = 100;
            item.rare = 10;
            item.useSound = 1;
            item.autoReuse = true;
            item.useTurn = true;
        }
        public override void AddRecipes()
        {
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.DirtBlock, 1);
            recipe.AddTile(TileID.WorkBenches);
            recipe.SetResult(this);
            recipe.AddRecipe();

        }
    }
}
 
the code is fine just make sure tha name of the sprite is the same as your wrote in the code here:
public class ExampleHammer : ModItem
and the sprite is in the folder is in the same place a you wrote here:
namespace ExampleHammer.Items.Weapons
and change back the Randomness I meant something else
 
the code is fine just make sure tha name of the sprite is the same as your wrote in the code here:
public class ExampleHammer : ModItem
and the sprite is in the folder is in the same place a you wrote here:
namespace ExampleHammer.Items.Weapons
and change back the Randomness I meant something else
This is how I have it:
Capture.PNG
 
Back
Top Bottom