So I'm currently developing a survival game. The problem I've run into is how to handle the data behind items. I want items to have unique metadata that can change throughout their lifetime, so I can't just tag a stick as "stick" and treat it the same as every other stick in the game. I also want to include class inheritance, so that if I change an element from a specific item group, like if I change some functionality behind the 'tool' class then all tools in my game will be updated.
I already have ideas behind how to handle the functionality behind this, but I'm really just struggling with how to organize class inheritance in the workspace. Having a module script for every sub-class and item is tedious, especially if some items inherit from more than one class. If I were to put all of the items in the same module script, that would be clunky to edit and I would probably struggle with overwriting variables constantly.
I think the closest comparison to what I'm trying to achieve is Minecraft, at least with how item data is tracked and handled by the game. If anyone has any suggestions or insight that would be greatly appreciated.

9 comments
If you find inheritance difficult to design around, have you heard of composition over inheritance? https://www.youtube.com/watch?v=wfMtDGfHWpA
Thanks, that's actually a really helpful video. Composition is definitely the move for me since the scope of my project is pretty large. It's much more adaptable.
also uh, never got around to reading your post i'll reply in a sec.
" I also want to include class inheritance, so that if I change an element from a specific item group, like if I change some functionality behind the 'tool' class then all tools in my game will be updated."
what are you trying to change. If you want to change some variable for every instance, you can keep track of your instances in some module and loop thru the instances, updating them.
but that seems a bit weird practice i feel like? what would need to be changed? can you give an example?
im also looking forward to creating a survival game, answering this question could also help me, also i think you should try asking Soybeen, the creator of roblox survival game booga booga on how he did this, maybe he would be willing to help, maybe not, he works in roblox so proceed with caution, nobody wants to end up like DevVince did after copying his game
@royaltoe If I were to change a mechanic behind tools, like how they interact with items, then I would need to manually update that for every tool in the game.
@Lord_WitherAlt So with booga booga the items are all generic and don't carry any metadata. Every Log is treated the same. In contrast, I might have two iron pickaxes in my game with different durabilities, names or enchantments, etc.