How do I test where the nearest wall is in Minecraft 1.16?

How do I test where the nearest wall is in Minecraft 1.16? - Person Wearing Blue Gloves Holding Plastic Container

I'm trying to create a minigame in which an armor stand is spawned about ten blocks away where you're looking. The problem is, you need to be able to hit the armor stand, and if you're facing a close enough wall, it spawns in the wall. Is there any way to test where a wall is, and spawn the armor stand in front of the wall?






Pictures about "How do I test where the nearest wall is in Minecraft 1.16?"

How do I test where the nearest wall is in Minecraft 1.16? - Student Cheating During an Exam
How do I test where the nearest wall is in Minecraft 1.16? - Student Getting A+ Mark in Her Exam
How do I test where the nearest wall is in Minecraft 1.16? - Crop man scarpering gray wall in flat





EVERYTHING in the Minecraft 1.16 Nether Update!




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

Images: ready made, RODNAE Productions, RODNAE Productions, Ksenia Chernaya