more wrong things with my codes

tyling123

Terrarian
using Terraria;
using Terraria.GameContent.Creative;
using Terraria.ID;
using Terraria.ModLoader;

namespace Aqonys.Items.Armor
{
// The AutoloadEquip attribute automatically attaches an equip texture to this item.
// Providing the EquipType.Body value here will result in TML expecting X_Arms.png, X_Body.png and X_FemaleBody.png sprite-sheet files to be placed next to the item's main texture.
[AutoloadEquip(EquipType.Body)]
public class ExampleBreastplate : ModItem
{
public override void SetStaticDefaults()
{
base.SetStaticDefaults();
DisplayName.SetDefault("Fiery Chestplate");
Tooltip.SetDefault("Hoooot"
+ "\nImmunity to 'On Fire!'"
+ "\n+20 max mana and +1 max minions");

CreativeItemSacrificesCatalog.Instance.SacrificeCountNeededByItemId[Type] = 1;
}

public override void SetDefaults()
{
Item.width = 18; // Width of the item
Item.height = 18; // Height of the item
Item.value = Item.sellPrice(gold: 23); // How many coins the item is worth
Item.rare = ItemRarityID.Green; // The rarity of the item
Item.defense = 19; // The amount of defense the item will give when equipped
}

public override void UpdateEquip(Player player)
{
player.buffImmune[BuffID.OnFire] = true; // Make the player immune to Fire
player.statManaMax2 += 20; // Increase how many mana points the player can have by 20
player.maxMinions++; // Increase how many minions the player can have by one
}

// Please see Content/ExampleRecipes.cs for a detailed explanation of recipe creation.
public override void AddRecipes()
{
CreateRecipe().AddIngredient<GuideVoodooDoll, 5 > ()
.AddTile<Tiles.Furniture.Hellforge>()
.Register();
}
}
}
 

Attachments

  • image_2022-07-04_104906331.png
    image_2022-07-04_104906331.png
    6.9 KB · Views: 29
I'm not sure if "CreateRecipe()" is a correct syntaxis, depending on what it returns, that depends on how that function looks like.
 
It's a missing semicolon, more of the error than just that screenshot is probably needed to find it as I can't find it in your code or alternatively, use an IDE, your best choice is most likely visual studio communit, the error checking saved many headaches.

Edit, don't listen to me, resP got it, idunno how I missed the number in the type <>
 
Last edited:
Your crafting recipe code is wrong. Taking the example mod example as is without understanding exactly the syntax will lead you to errors as you have right now
There are two ways of getting items
The one in example mod is getting mod items so the syntax is
Code:
.AddIngredient<TheModItemName>(8)
The item you want to get is between <>() and if you want more than one you put the value between the ()

Your code wants to use vanilla items so this means you have to write it like this
Code:
.AddIngredient(ItemID.GuideVoodooDoll, 5)
Then the item is between () and if you want more than one, as you have writen you add a , and then the number.

Will all that said, your code should be

Code:
public override void AddRecipes()
        {
            CreateRecipe()
            .AddIngredient(ItemID.GuideVoodooDoll, 5)
            .AddTile(TileID.Hellforge)
            .Register();
        }
 
Back
Top Bottom