5

So I'm working on a system for smooth granite to be "push-able" after the player obtains an item (for a Zelda-style adventure map). I put together the following command system, all of which are in a repeating command block, and it worked perfectly:

/scoreboard players reset @a[score_pushDelay_min=10] pushDelay

/execute @a ~ ~ ~ detect ~.5 ~ ~ stone 2 scoreboard players add @a pushDelay 1

/execute @a[score_pushDelay_min=10] ~ ~ ~ detect ~1 ~ ~ stone 2 execute @a ~ ~ ~ detect ~2 ~ ~ air 0 clone ~1 ~ ~ ~1 ~ ~ ~2 ~ ~ masked move

THEN, I removed the redstone blocks next to the commands (with the intent of having them placed back once the player obtained the specified item to active the system), but when I put them back (exactly as they were before) nothing worked. Now the output for the second command simply reads "Failed to execute 'detect' as hamsterhuey17."

Any idea what the heck is wrong with it, and how to fix before I tear my hair out?

EDIT: It seems that the issues comes in with the order of the replacement redstone blocks being placed. If those powering command [3] are replaced, it won't work until I've also deleted/replaced the one powering command [1]...

4
  • Is "masked move" part of the command? Commented Jun 20, 2016 at 15:07
  • 1
    The command seem to work as intended for me, the problem seems to be something else. Are you sure there is a granite block to your east, and space for it to move into? Are the command blocks actually running?
    – SirBenet
    Commented Jun 20, 2016 at 15:10
  • The "masked move" portion clears the old block when it creates the new one and yes, is part of the command. Commented Jun 20, 2016 at 15:40
  • As for the space/direction, I have four identical commands like the one above (one for each pos/neg direction on both x and z) and I'm testing it on a superflat world with unlimited space, so I don't think it can be that... What throws me off is that it WAS working before I replaced the redstone. Commented Jun 20, 2016 at 15:42

1 Answer 1

4

I put together the following command system, all of which are in a repeating command block

This does not guarantee activation order. You should be using Chain command blocks to clearly define the order in which command blocks are activated. In the following image, the Repeating block is activated first and then follows the arrows in the Chain blocks:

Repeating > Chain > Chain

The Chain blocks must be set to "Always Active", and you can stop the clock by stopping just the Repeating block. You can do this either with physical redstone or using /blockdata to shut the clock off:

/blockdata X Y Z {auto:0b}

It seems that the issues comes in with the order of the replacement redstone blocks being placed

There is a specific order in which the redstone blocks are placed via the /fill command, as well as the order in which redstone mechanisms are activated around that block. In this guide, the following image describes that order:

West, east, down, up, north, south

The numbered spaces around the redstone block is which block gets powered first when the redstone block is placed. /fill follows the same pattern when creating redstone blocks.

You should no longer be relying on this type of activation and instead use Chain blocks. Block update order and /fill order is not guaranteed to remain the same.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.