I can see you're searching for something that's not obvious through tunnel vision. Object oriented programming is the easy answer.
An array can contain different types of objects in each 'slot'.
Inventory[0][01] might be a curative item (object) that contains it's own information on what healing properties it has. Each item can contain a 'sell value.'
Inventory[1][00] might store a 'weapon object', which also stores it's own objects, some of which would define a new weapon ability or a list of materia objects that belong to that weapon.
Inventory[7][01] Could contain a list of all the materia a player has found so far. Each materia object could also contain a reference to the weapon they currently belong to.
Other programmable systems (User Interfaces here) in the theoretical game can be sort of a 'watcher', and 'watch' for different things depending on what the user is currently focused on.
If the user is in a menu to equip materia, the UI would offer more detailed information about that materia if the user pressed a specified button for more info. More importantly, we would provide easy access through the UI to open a relevant menu, such as the Weapon Equipment screen.
Each weapon holds a set number of materia, which can grow in number, so we could make that a list or array of materia objects, which each also happen to keep track of which weapon they currently belong to. Of course each materia object also would keep track of other information as well.
If our first weapon currently had 4 materia slots, let's look at the materia in the first weapons second materia slot as an object.
Inventory[1][00].materia[01].basicinfo(). The results would be: "I'm an assess materia."
Assess would also be an object that contains info about itself, as well as info about other things.The ability contained within the assess object would probably have to be triggered by something in the battle system for it to be effective in the case of gameplay. Inventory[1][00].materia[01].explanation.toString() would return a string that explains what the assess materia is supposed to do. You could even add an "Inventory[1][00].materia[01].explanation.toString().errormessage" if you wanted to send a message in the rare case that your code wasn't perfect.
You can also refer to 'slot numbers' in arrays by using more human readble 'strings', but that might be an introduction to "making my game run efficiently vs making it easier for others to help me make my game", ie Unreal Engine vs creating something from scratch.