2

In a 13x13 area, command blocks should locate any redstone dust currently placed, and change the block beneath it to wood planks.

But, I see no possible way to do this, or am I missing something?

  • 2
    I believe you have stumbled upon one of the bigger issues with command blocks. They suck at locating blocks. You could teleport an armor stand around, but this is fairly slow (1 block per tick, so 8,5s total for a 13x13x1 area) and requires some effort. Or you can summon 169 armor stands at the cost of summoning 169 armor stands :) – MrLemon Jun 23 '16 at 12:35
  • 1
    If you wouldn't mind using mods, I would maybe know some solution (writing a mod for that) – Antoine Hejlík Jun 23 '16 at 13:08
  • 1
    @MrLemon it's enough to testfor blocks only around the player (which placed the dust): 25 instead of 169 ArmorStands :D – RudolfJelin Jun 24 '16 at 15:55
1

My best idea is to summon 169 (13 x 13) armor stands, one on each block (you probably want to name them something too). Then you would run a command such as:

/execute @e[type=ArmorStand,name=SOMENAMEHERE] ~ ~ ~ detect ~ ~ ~ redstone_dust 0 /setblock ~ ~-1 ~ planks

Or if 169 armor stands causes too much lag, you could decrease the amount of armor stands by only summoning one armor stand for every 2 blocks, running the execute command, teleporting all the armor stands 1 block forward, and running the command again. Note that this method will take 2 ticks to run whereas the first can do everything in 1 tick.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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