is there a way to check every slot in players inventory for a item with specific tag?

so i have a inventory of a target @a[tag=veruty_dream.reversed_gravity] and a item with "minecraft:custom_data": "{veruty_dream_gravity_device:true}" is there a way to check for this item or lack of it in hotbar, 27 slots above it and offhand?
Continue to help post