Minecraft block detection for a specific block

minecraft-commandsminecraft-java-edition

Is it possible to use commands or redstone devices (or a combination) to detect for a specific block placed in a specific coordinate and output a redstone current if so?

For instance, if I place a stone block in the coordinates (1,2,3), a command block will execute.

I'm sure /testforblock could be useful, but I just can't figure out how. All that does is tests if a block is there; it doesn't do anything if that resolves to true.

Assume version 1.12, if that makes things easier.

Bonus points: Same thing, but detecting if a specific entity is in the supplied coordinates. Again, /testfor seems useful, but I'm unsure how.

Best Answer

If you place a comparator in front of a command block with

testforblock x y z

Then it should yield a redstone signal. You may want to place a repeater in front of the comparator.

A visual guide: