using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace ExampleMod.Items { public class ExamplePet : ModItem { public override void SetStaticDefaults() { // DisplayName and Tooltip are automatically set from the .lang files, but below is how it is done normally. // DisplayName.SetDefault("Paper Airplane"); // Tooltip.SetDefault("Summons a Paper Airplane to follow aimlessly behind you"); } public override void SetDefaults() { item.CloneDefaults(ItemID.ZephyrFish); item.shoot = mod.ProjectileType("ExamplePet"); item.buffType = mod.BuffType("ExamplePet"); } public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(null, "ExampleItem", 10); recipe.AddTile(null, "ExampleWorkbench"); recipe.SetResult(this); recipe.AddRecipe(); } public override void UseStyle(Player player) { if (player.whoAmI == Main.myPlayer && player.itemTime == 0) { player.AddBuff(item.buffType, 3600, true); } } } }