Trying to get my bow to have a % to not consume ammo, but it says there's 1 error being: "no suitable method found to override"

profanedsauced

Terrarian
using System;
using System.Collections.Generic;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.GameContent.Creative;
using Terraria.DataStructures;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;

namespace ForbiddenWeaponry.Content.Items.Weapons.Ranged
{
internal class UndeathBow : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Bow of Undeath");
Tooltip.SetDefault("Endowed with vengeful dungeon spirits, this bow will show no mercy.");
CreativeItemSacrificesCatalog.Instance.SacrificeCountNeededByItemId[Type] = 1;
}

public override void SetDefaults()
{
Item.width = 32;
Item.height = 32;

Item.useStyle = ItemUseStyleID.Shoot;
Item.autoReuse = true;
Item.useTime = 19;
Item.useAnimation = 5;
Item.DamageType = DamageClass.Ranged;
Item.damage = 66;
Item.knockBack = 8f;
Item.scale *= 1.5f;
Item.shoot = 10;
Item.shootSpeed = 20f;
Item.useAmmo = AmmoID.Arrow;
Item.value = Item.buyPrice(gold: 15);
Item.rare = ItemRarityID.Pink;
}
public override bool ConsumeAmmo(Player player)
{
if (Main.rand.Next(0, 101) <= 67)
return false;
return true;
}

public override void AddRecipes()
{
CreateRecipe()
.AddIngredient(ItemID.WoodenBow, 1)
.AddTile(TileID.Anvils)
.Register();
}
}
}
 
1661477991850.png

Have neither code in C# nor made a mod in TML but um
 
It does not work because ConsumeAmmo is not a function within ModItem, the full list of classes and functions for tModLoader can be found here: Terraria ModLoader: Main Page

The function you need should be CanConsumeAmmo(Item ammo, Player player)
 
Back
Top Bottom