Maybe you were looking for...

How can I remove a specific amount of items from a player with commands, only when the player has equal or more than the requiered items? [duplicate]

I know how to do it, with specific quantity of items, such as 2 ender eyes, for example: /execute if data entity @p {Inventory:[{id:"minecraft