execute if block ~ ~ ~ minecraft:anvil[facing=north] run scoreboard players set @s bw_block 1020
execute if block ~ ~ ~ minecraft:anvil[facing=east] run scoreboard players set @s bw_block 1021
execute if block ~ ~ ~ minecraft:anvil[facing=south] run scoreboard players set @s bw_block 1022
execute if block ~ ~ ~ minecraft:anvil[facing=west] run scoreboard players set @s bw_block 1023