Minecraft block detection for a specific block

Minecraft block detection for a specific block - Woman in Black Dress Shirt and Black Pants Sitting on Concrete Bench

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.






Pictures about "Minecraft block detection for a specific block"

Minecraft block detection for a specific block - Assorted-color House Facade in Park
Minecraft block detection for a specific block - White shabby concrete wall with cracked stucco
Minecraft block detection for a specific block - Man in Black Jacket Sitting on Block



Can you locate a specific block in Minecraft?

The blank is for the particular block you are looking for. Let's say you're lost in the Nether and need to find your Nether Portal, you could type : /locateblock obsidian, and get the coordinates for the nearest obsidian, most likely being your, said, Portal.




Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

Images: Andrey Karpov, Pixabay, Tatiana Syrikova, Lisa