how do I testfor blocks? like if I put down stone near a command block with a comparator attached to it and it will activate a piston connected by the comparator on the command block? please answer.
/testforblock has been deprecated. New command is
/execute if block.
/execute if block 10 64 10 stone
You can now run a success command directly in the same command:
/execute if block 10 64 10 stone run give @p diamond_shovel
You can also use
unless to negate the check:
/execute unless block 10 64 10 stone run give @p diamond_shovel