I have a dropper which can contain, of course, any items. Assuming I can already target this dropper in a command's target selector, how can I determine what item is in the first slot of its inventory and use that item ID for another command? Alternatively, if this dropper is triggered and spits out the item as an entity, is there a way to determine what type of item the entity is and use that?
Basically, I'm trying to use command blocks to turn a certain dropper into a block-placer. But for that to be useful, it should be able to take whatever type of block the player puts in its inventory and place that. How can I determine what type of block is there? The only way I can think of is to check the inventory for literally every type of block in the game, but that would require over a hundred command blocks and be highly inefficient. Is there a better way?