Detecting when items are changed

Hi! Previously, I had been trying to create a custom GUI, but I decided to simplify it to just be a dropper with no button items. Players will place a wand in an item frame on top, and the custom block (which I have decided to call a Spell Altar) will display all the spells within that wand to be added to and removed at will. When the player is done, they will remove the wand and the block will be cleared, so the spells only exist inside the wand. This is a great idea in theory, but it's a lot of checks and functions, and I was wondering if I could make the updating functions only run when the items within the dropper are changed.

Tl;dr I need a way to detect when the items within a container are changed :3

Continue to help post