How to get an base interface from an extended script

I apologize there is no TLDR; and also I apologize if my terminology is incorrect.

Greetings.

I have 3 scripts, each extending from the previous respectively.
each script has an Interface assigned to it, respectively named according to its base script

Example:

Base script Item.cs
Interface IItem attached to Item.cs - has itemname, slug, description ect.

Item.cs is extended with Weapon.cs
Interface IWeapon attached to Weapon.cs - damage, 2h or not, sound effects ect

Weapon.cs is extended with MeleeWeapon.cs
Imelee attached to MeleeWeapon.cs - (stab or slice?), air cut effect graphic ect

(TLDR; Sorta) How do I get itemname from IMelee?
I want it, so only melee weapons can do damage here. I would also like to know what melee weapon was used to do the damage.

I could just pass IItem, IWeapon, and Imelee to where I eventually need them, but it would be much cleaner if I could simply pass IMelee, and get all my info like so:

DoFoo(other.GetComponent<IMelee>());

void DoFoo(Imelee weapon){
print(weapon.itemName);
print(weapon.type); // as in stab, slash, or blunt
}```

I always try to limit my question size, so if more info is needed, do ask!!

Thank you for your time!

Not sure why you’re using Interfaces AND derived classes here, what’s the purpose of the IMelee interface, will anything other than a MeleeWeapon ever implement IMelee?

Normally you would need to have the same level of inheritence at the interface level:

public interface Iitem{
    string itemName{get;}
}

public interface IWeapon : Iitem{
    //IWeapon required fields/methods IWeapon can also call itemName since it derives from Iitem
}

public interface IMelee : IWeapon{
    //here you can access IWeapon and Iitem fields
}

Again not sure why the interface is needed here as you could simply do:

void DoFoo(MeleeWeapon weapon){
    weapon.itemName;
}

I know. I know. lol.

Well, originally I had intended on making weapons with different script names, but ended up combining them all together, I know its redundant, but the rest of the game is working off that system now.

But, you’re right. Its not that big of a deal; I’ll just rewire things. I’ve been thinking of removing the interfaces anyway. Thanks for the push lol.