###Maintains Min and Max Heights###
scoreboard players set @s[scores={nitPillarTier=..0}] nitPillarTier 1
scoreboard players set @s[scores={nitPillarTier=6..}] nitPillarTier 5

###Remove Sand Entities
kill @e[type=item,nbt={Item:{id:"minecraft:sand"}},distance=..2]

###Sets pillar height
execute at @s[scores={nitPillarTier=1}] run setblock ~ ~0 ~ minecraft:sand
execute at @s[scores={nitPillarTier=1}] run setblock ~ ~1 ~ minecraft:air

execute at @s[scores={nitPillarTier=2}] run setblock ~ ~1 ~ minecraft:sand
execute at @s[scores={nitPillarTier=2}] run setblock ~ ~2 ~ minecraft:air

execute at @s[scores={nitPillarTier=3}] run setblock ~ ~2 ~ minecraft:sand
execute at @s[scores={nitPillarTier=3}] run setblock ~ ~3 ~ minecraft:air

execute at @s[scores={nitPillarTier=4}] run setblock ~ ~3 ~ minecraft:sand
execute at @s[scores={nitPillarTier=4}] run setblock ~ ~4 ~ minecraft:air

execute at @s[scores={nitPillarTier=5}] run setblock ~ ~4 ~ minecraft:sand
execute at @s[scores={nitPillarTier=5}] run setblock ~ ~5 ~ minecraft:air

###Clear Condition###
execute if score @s nitPillarTier matches 5.. run tag @s add nitClearCondition
execute if score @s nitPillarTier matches ..4 run tag @s remove nitClearCondition