I need a command to detect if a block is over a players head. I have only found commands to detect if the block is under a player. Do anyone have a command to detect blocks over players heads? :)

  • 1
    It's the exact same command, just with different relative coordinates. – Fabian Röling Oct 13 '19 at 22:10
/execute @p ~ ~2 ~ testforblock ~ ~ ~ <block>

Replace with the block you would like to sense.

  • OMG! Thank you so much! This really helped me :D – xAr1an4 Nov 16 '19 at 16:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.