im trying to make it so a command block emits a redstone signal if a block is there. im trying to do this in Minecraft 1.12.2.

  • What have you already tried, and did you do any research before asking? Arqade works best when you share past research/past trials, that way we can see the specific problem you're having.
    – One 2 Many
    Commented Sep 16, 2020 at 3:37

1 Answer 1


Read about the "testforblock" command: https://www.digminecraft.com/game_commands/testforblock_command.php

You can have the command block say /testforblock <x> <y> <z> <block>

Heres an example: /testforblock ~ ~-1 ~ diamond_ore

The /testforblock command works in 1.12.2

To have it continuously check, set it to repeat.

To detect when it has found the block, you can have a comparator running out from the command block.

  • Ok sorry I'll do that next time. Commented Sep 16, 2020 at 2:58
  • The question explicitly states that the OP is using Minecraft 1.12.2 Commented Sep 16, 2020 at 3:18
  • 2
    @RayWu /testforblock works in 1.12. What makes you think that darthvader1925 didn't take the version number into account?
    – One 2 Many
    Commented Sep 16, 2020 at 3:32
  • I have edited it. I hope this makes it more clear. Commented Sep 16, 2020 at 3:43
  • @ExpertCoder14 Sorry, I confused 1.12 and 1.13. Commented Sep 16, 2020 at 16:00

You must log in to answer this question.