tag @s add cactus

execute if block ~ ~ ~0.5 pink_stained_glass run damage @s 1 minecraft:cactus
execute if block ~ ~ ~-0.5 pink_stained_glass run damage @s 1 minecraft:cactus
execute if block ~0.5 ~ ~ pink_stained_glass run damage @s 1 minecraft:cactus
execute if block ~-0.5 ~ ~ pink_stained_glass run damage @s 1 minecraft:cactus
execute if block ~ ~-0.5 ~ pink_stained_glass run damage @s 1 minecraft:cactus
execute if block ~ ~1 ~0.5 pink_stained_glass run damage @s 1 minecraft:cactus
execute if block ~ ~1 ~-0.5 pink_stained_glass run damage @s 1 minecraft:cactus
execute if block ~0.5 ~1 ~ pink_stained_glass run damage @s 1 minecraft:cactus
execute if block ~-0.5 ~1 ~ pink_stained_glass run damage @s 1 minecraft:cactus