Uploaded image for project: 'Minecraft (Bedrock codebase)'
  1. Minecraft (Bedrock codebase)
  2. MCPE-52581

Clone command updates destination unconditionally

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.14.20 Hotfix, 1.13.0.17 Beta, 1.12.1, 1.13.0, 1.14.60 Hotfix, 1.16.20, 1.17.0, 1.20.32 Hotfix
    • Confirmed
    • Windows
    • 397644, 107151

      If you issue a /clone command that doesn't copy any blocks, either because the source region is empty or because the destination region already contains matching blocks, the command outputs "No blocks cloned". If it was issued by a command block, any conditional command block that depends on the command's success does not run its command. This is all as expected.

      However, an observer facing a block in the destination region detects an update anyway. It even detects an update if the block it's facing is air!

      This behavior is illogical. If the command didn't clone any blocks, there shouldn't be any change for the observer to detect, and in any case, an observer shouldn't detect a change in an air block because there's nothing there to detect.

      This bug has practical consequences. I was using an observer to detect when a block was placed and activate command blocks to fill an area with that block. I wanted to do this from two locations, but if I changed the block at one location the other location no longer correctly reflected what was in the filled area. So I tried to add more command blocks to clone whichever block I'd just placed to the other location, as if I'd placed it there, too. Of course, cloning to the distant location was detected by its observer, which caused it to try and clone its block back to my current location. Since my current location already had that block, the second clone command should have failed and had no effect, and in fact its result was "No blocks cloned". Nevertheless, the observer at my current location was updated, and the consequence was an infinite loop.

      There is a related bug which I discovered while trying to solve the above problem, and which I will link as a related report once I've created it.

      The attached world save demonstrates this issue. It uses an impulse command block to clone a diamond block. The destination area is being watched by an observer, which lights a redstone lamp when it detects something. A conditional command block displays a message if the impulse command block executes its command successfully.

      Steps to reproduce:
      1. Open the attached world.
      2. Press the button on the impulse command block.
      Result: The diamond block is cloned to the air block beside it. The chat stream displays the message "1 block cloned", followed by the message "Clone command succeeded" from the conditional command block. The observer detects the cloned diamond block being place and activates the redstone lamp.
      3. Press the button again.
      Result: Since there is already a diamond block at the destination, the clone command does not clone any blocks. If its Previous Output field is enabled, it records the message "No blocks cloned". The conditional command block does not activate because the command failed.
      Expected Result:
      The observer doesn't detect any change in the destination block.
      Actual Result:
      The observer detects a change in the destination block and activates the redstone lamp. This happens even if the clone source and destination areas contain nothing but air.

        1. MCPE-52581.mcworld
          49 kB
          [MCPE Mod] Auldrick

            Auldrick [MCPE Mod] Auldrick
            Votes:
            3 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              CHK: