Testfor command for a block

Testfor command for a block - Unrecognizable woman holding paw of dog

I am trying the testfor command on a block, is that possible? When it is mined , I want the testfor to turn off.

enter image description here

For example, when this green wool block is mined up, the command block that has the testfor command will turn off, for it can't find the block there. Can this work somehow?



Best Answer

Found it:

testforblock <x> <y> <z> <TileName> [dataValue] [dataTag]

Here: How to testfor blocks not people




Pictures about "Testfor command for a block"

Testfor command for a block - White shabby concrete wall with cracked stucco
Testfor command for a block - Crop hacker silhouette typing on computer keyboard while hacking system
Testfor command for a block - Assorted-color House Facade in Park



Quick Answer about "Testfor command for a block"

  • Test if Players are within 10 blocks. In this example, we will test to see if there are any players within a 10 block radius with the following command: /testfor @a[r=10] ...
  • Test if Mooshrooms are within 50 blocks. ...
  • Test if Nearest Player is at Level 20 experience.


Is there a command to find blocks?

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.

How do you use the Testfor command in bedrock?

The /testfor command became obsolete in Minecraft 1.13, and has been replaced by the /execute command*. It will do the same as typing /testfor @e {SelectedItem:{id:"<item>"}} and then putting a comparator to the command block with the command, and then running the command which you wanna run.



Learn Command Blocks (Ep 2): Testfor \u0026 Testforblock




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

Images: Ivan Babydov, Tatiana Syrikova, Anete Lusina, Pixabay