#for looking at negative z side - north side:
tag @s add bw_5

scoreboard players set @s bw_calc 0
execute if block ~ ~1 ~ #bw:gothrough if blocks ~ ~1 ~1 ~ ~1 ~1 ~ ~ ~1 all run scoreboard players add @s bw_calc 1
execute if block ~ ~-1 ~ #bw:gothrough if blocks ~ ~-1 ~1 ~ ~-1 ~1 ~ ~ ~1 all run scoreboard players add @s bw_calc 2
execute if block ~1 ~ ~ #bw:gothrough if blocks ~1 ~ ~1 ~1 ~ ~1 ~ ~ ~1 all run scoreboard players add @s bw_calc 4
execute if block ~-1 ~ ~ #bw:gothrough if blocks ~-1 ~ ~1 ~-1 ~ ~1 ~ ~ ~1 all run scoreboard players add @s bw_calc 8

execute if score @s bw_calc matches 1..3 run scoreboard players set @s bw_mcxyz 7
execute if score @s bw_calc matches 4.. run scoreboard players set @s bw_mcxyz 5

#if the score didn't change from the commands in this function, set the direction score to x-direction as a "default"
execute if score @s bw_calc matches 0 run scoreboard players set @s bw_mcxyz 5
#set the score back as to not run the other commands in function line
scoreboard players set @s bw_calc 1