Setblock clock with scoreboard doesn't work in Minecraft

I’ve been trying some things with scoreboard lately and I always get to the point where I need to use the following commands.

/scoreboard players set @a Holding 0
/scoreboard players set @a Holding 1 {DataTag}
/execute @e[score_Holding_min=1] ~ ~ ~ /summon LightningBolt ~ ~ ~

People tell me to connect these to the same setblock clock but in order. I do that this way.

  • Minecraft Keeps crashing when fullscreened on server
  • Can creatures follow me through a portal?
  • Giving players one arrow every two seconds, possibly with /replaceitem
  • Minecraft Empty Chests Command Block
  • I can't connect to a friend's Minecraft server, but none of the usual culprits seem to be the problem
  • After installing Minecraft, I cannot figure out how to start the game
  • But nothing happens. The problem seems that the Holding score is set back to 0 too fast for the execute command to work. Does anyone know how to make this setup work?

  • Does player movement speed up mob spawners?
  • Clear item with custom name?
  • Movement and digging/mining speed
  • What is the fastest way to travel long distances in Minecraft?
  • How do I use F3 to get my coordinates when my laptop makes F3 a special key?
  • Stuck in pet moving situation
  • 2 Solutions collect form web for “Setblock clock with scoreboard doesn't work in Minecraft”

    Your command blocks are placed in the wrong order in the world.

    When multiple command blocks are powered at the same time, they are executed in the direction of +X, +Y and +Z. It is very likely that your line of redstone “points” in the -X or -Z direction, thus making the game run the commands in reverse order:

    /execute @e[score_Holding_min=1] ~ ~ ~ /summon LightningBolt ~ ~ ~
    /scoreboard players set @a Holding 1 {DataTag}
    /scoreboard players set @a Holding 0
    

    This leaves every players Holding score at 0 at when the execute command is run, therefore it does not execute properly.


    In 1.9+, chain command blocks should be used to easily prevent such issues.

    I have already found a solution myself. This is the working setup:

    Take note that the Holding 0 block is at the end and that no redstone is on top of it. This worked for me. After reading some comments, it seems that the location of the redstone blocks was the problem. The order in which the commands are executed goes from low to high, so from a low X to a higher X. The same goes for the Y and Z coordinates.

    We love Playing Games, especially Video Games.