execute @e with scoreboard does not work

execute @e with scoreboard does not work - Laughing businesswoman working in office with laptop

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"

execute @e with scoreboard does not work - Man in Blue Suit
execute @e with scoreboard does not work - Successful multiethnic business colleagues in modern office
execute @e with scoreboard does not work - Low angle of successful female executive manager in classy style sitting at table with laptop in contemporary workplace and passing documents to colleague



How do you use the execute if score command?

Scoreboard Command
  • To add an objective: /scoreboard objectives add <objective> <criteria> [displayName]
  • To remove an objective: /scoreboard objectives remove <objective>
  • To list all objectives: /scoreboard objectives list.
  • To set how the objectives are displayed: /scoreboard objectives setdisplay <slot> [objective]


  • How 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