Help with Command Block Entity Detection?

Flexico

Well-Known Member
Dec 15, 2012
328
39
53
What I'm trying to do is, make a command block/redstone contraption that allows a coal block to be compressed into a diamond, if six blocks of TNT are detonated around it on the same tick. I'm fairly new to command blocks, so my attempts as getting the output I need from /testfor have just left me rather confused.