How to prevent grabbing items from a closed inventory?

I ended up figuring it out. I added a couple of interfaces, one of which referenced the backpack and another to check if Item is attached. Made a function to check if bag is closed and if item is attached, then ran it through a branch which checked those two states.