Am trying to make an area that will only allow players to enter if they have 20+ ender dragon kills so in order to prevent people from going in that area with less kills i made an executing command that runs as an armor stand with the tag shulker. To test the command i used a give command since i do not want to somehow end up in an infinite teleportation loop. The command seems to work fine when i use it with the chat but when i put it on a command block the command ignores the distance and just keeps giving me dirt no matter how far i am.
Here is the command:
/execute as @e[tag=shulker,distance=0..10] run give @a[scores={dragon_death=19..}] coarse_dirt 1