How to check if a slot of a container block is empty?

I want to make a custom crafing system using droppers and need to check if certain slots are filled with the correct items. I can't find a way to check if certain slots are empty though. As not all recipes need every slot to be filled, this can cause wrong items in the unchecked slots to dissapear with the rest. Is it possible to check if a slot is empty somehow?


Solution 1:

If a dropper slot is empty it means the corresponding compound tag with property Slot does not exist. Use /execute unless data to check if the slot is empty:

execute unless data block 12 23 34 Items[{Slot:0b}] run ...