What is wrong with the following Minecraft Command?

la
4

I'm trying to build a click detector, but I don't understand what's wrong with this command: execute as @e [tag = Dirt] at @s if entity @e [type = armor_stand, tag = RightClickDemodistance = .1, nbt = {HandItems: [{id: "minecraft: dirt", Count: 1b}, {}]}] run give @s diamond

Can somebody help me?

Be

Tag = RightClickDemodistance = .1

either you mean a score or a day

With a score:

scores = {RightClickDemodistance = .1}

Or in a day:

tag = RightClickDemodistance

la

So is this = .1 unnecessary?

Be

Depends on what you want to test

RightClickDemodistance is either a scoreboard or a tag. If it is a day, it is unnecessary, otherwise you will need it

la

Found the error, forgot a comma between RightClickDemo and Distance xD. But thanks anyway