Minecraft 1.16.5 give if advancement command

I want a to make a command block give me or another player a block as a reward for the mine_diamonds advancement but all I ended up with is execute if entity @a[advancements={story/mine_diamonds=true}] run give @s lucky:lucky_block and it, sadly, doesn't work. It has no output. I don't use commands that much and seemed working for me before i wrote it in. What should I do for it to work properly without distance limitations though? Thanks in advice.


Solution 1:

I know this is a somewhat old post but if you haven't figured it out on your own already, the advancement is story/mine_diamond not story/mine_diamonds. I assume you just mistyped

so the command would just be execute if entity @a[advancements={story/mine_diamond=true}] run give @s lucky:lucky_block