jamiesmith9255
Steampunker
I was ok back in the day using Tapi and its been over 2 or so years since i'v modded and i'm vary rusty i want to know if some one can give me a hand on what i'm doing wrong? I foe a basic Sword.
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;
namespace YourModName.Items.Weapons //where is located
{
public class YourSword : ModItem
{
public override void SetDefaults()
{
item.name = "Test Blade"; //Sword name
item.damage = 130; //Sword damage
item.melee = true; //if it's melee
item.width = 78; //Sword width
item.height = 78; //Sword height
item.toolTip = "My Best Moded Sword"; //Item Description
item.useTime = 25; //how fast
item.useAnimation = 25;
item.useStyle = 1; //Style is how this item is used, 1 is the style of the sword
item.knockBack = 5; //Sword knockback
item.value = 100;
item.rare = 10;
item.useSound = 1; //1 is the sound of the sword
item.autoReuse = true; //if it's capable of autoswing.
item.useTurn = true;
item.shoot = mod.ProjectileType("YourProjectileName");
item.shootSpeed = 8f; //projectile speed
}
public override void AddRecipes() //How to craft this sword
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.DirtBlock, 1); //you need 1 DirtBlock
recipe.AddTile(TileID.WorkBenches); //at work bench
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;
namespace YourModName.Items.Weapons //where is located
{
public class YourSword : ModItem
{
public override void SetDefaults()
{
item.name = "Test Blade"; //Sword name
item.damage = 130; //Sword damage
item.melee = true; //if it's melee
item.width = 78; //Sword width
item.height = 78; //Sword height
item.toolTip = "My Best Moded Sword"; //Item Description
item.useTime = 25; //how fast
item.useAnimation = 25;
item.useStyle = 1; //Style is how this item is used, 1 is the style of the sword
item.knockBack = 5; //Sword knockback
item.value = 100;
item.rare = 10;
item.useSound = 1; //1 is the sound of the sword
item.autoReuse = true; //if it's capable of autoswing.
item.useTurn = true;
item.shoot = mod.ProjectileType("YourProjectileName");
item.shootSpeed = 8f; //projectile speed
}
public override void AddRecipes() //How to craft this sword
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.DirtBlock, 1); //you need 1 DirtBlock
recipe.AddTile(TileID.WorkBenches); //at work bench
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}