It seems like the event is far less useful without having a specific thing being clicked on. I can understand there being conflicts with fungible items and opening in the hotbar, but if you wanted an item-with-tags, or a specific selection concept, or an item-with-inventory, you can't know which from the event.
Blueprint-like objects in the library can just be discarded for this event or not even raise, it would probably be a mess.
Add item_stack to on_mod_item_opened
Add item_stack to on_mod_item_opened
I have mods! I guess!
Link
Link
Re: Add item_stack to on_mod_item_opened
+1, I'd appreciate this to be able to create something akin to a custom deconstruction planner. The player could create multiple instances of a selection-tool, each with their own data/settings which can be edited via a custom GUI that's opened by on_mod_item_opened. I can manage the per-item data with item_number, but as far as I can tell there is no way to determine which specific item instance was opened in on_mod_item_opened--just the prototype of the item.
Re: Add item_stack to on_mod_item_opened
I could add it, however it's not going to be guaranteed accurate since the event can originate from literally any item in any stack. It may happen that slot [3] was clicked and is a simple iron plate. In the event for mod A, it clears the entire inventory putting power armor in all slots. Then mod B runs and is just going to get "slot [3]" which is power armor at that point.
If you want to get ahold of me I'm almost always on Discord.
Re: Add item_stack to on_mod_item_opened
Wouldn't it make sense to pass the item_number, if one exists? It wouldn't perfectly get the item that was opened since not all have them, but wouldn't it cover most cases where people actually care about the item, since it's usually those that have data tied to them?
Re: Add item_stack to on_mod_item_opened
item_number should be able to work just as well for my use case, if that would make more sense in general!
Re: Add item_stack to on_mod_item_opened
Item number only exists for complex item types. The event can be triggered by any type (basic iron plate with no data, thus no item number).PennyJim wrote: Tue Feb 17, 2026 12:07 am Wouldn't it make sense to pass the item_number, if one exists? It wouldn't perfectly get the item that was opened since not all have them, but wouldn't it cover most cases where people actually care about the item, since it's usually those that have data tied to them?
If you want to get ahold of me I'm almost always on Discord.
Re: Add item_stack to on_mod_item_opened
If the event were to pass item number, wouldn't it be fair to just pass nil for the basic items which don't have item numbers? As PennyJim said, that should cover most use cases.Rseding91 wrote: Tue Feb 17, 2026 1:02 am Item number only exists for complex item types. The event can be triggered by any type (basic iron plate with no data, thus no item number).
Also, forgive my minimal understanding of how all this works internally, but couldn't the item stack passed to the event (supposing you do implement that) just be the item stack that originated the on_mod_item_opened event in the first place? And sure, if some other mod completely destroys the item stack, then it would be invalid. The event does pass LuaItemPrototype data currently, and in your example, surely mod B is not getting passed the LuaItemPrototype for power armor. (If it is, then fair enough. Can't test it myself at the present moment.) So I'd imagine there must be some way to tie the event data back to the item that originally caused the event to fire.Rseding91 wrote: Tue Feb 17, 2026 12:01 am I could add it, however it's not going to be guaranteed accurate since the event can originate from literally any item in any stack. It may happen that slot [3] was clicked and is a simple iron plate. In the event for mod A, it clears the entire inventory putting power armor in all slots. Then mod B runs and is just going to get "slot [3]" which is power armor at that point.



