execute @e with scoreboard does not work

I have a squid with a custom name of "Create_Pig_Alter", and whenever it is "standing" on stone, I want to set a scoreboard objective for the squid. I've tried the following command, but it isn't working:
/execute @e[name=Create_Pig_Alter] ~ ~ ~ detect ~ ~-1 ~ stone /scoreboard players set @e PigAlterProgress 1
What am I doing wrong?
Best Answer
"detect" syntax for /execute
:
/execute <target> X Y Z detect X Y Z <block> <Damage> <command>
You are missing the Damage value of the block. You can set the value to -1 to signify any value. Fixed command using a value of 0 for regular smooth stone:
/execute @e[name=Create_Pig_Alter] ~ ~ ~ detect ~ ~-1 ~ stone 0 /scoreboard players set @e PigAlterProgress 1
Pictures about "execute @e with scoreboard does not work"



How do you use the execute if score command?
Scoreboard CommandHow do you activate scoreboard in Minecraft?
The syntax for the scoreboard would be "/scoreboard objectives add Money dummy" without parenthesis. To place this scoreboard to the sidebar, Minecraft players can then use the command "/scoreboard objectives setdisplay sidebar Money" which should display the scoreboard to the right of the screen./execute if score // Minecraft 1.19 Command Tutorial
More answers regarding execute @e with scoreboard does not work
Answer 2
scoreboard can't have more than 15 chars so "PigAlterProgress" is too long. And indeed you must use a fill/setblock clock in those cases.
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Andrea Piacquadio, The Lazy Artist Gallery, Alexander Suhorucov, Andrea Piacquadio