Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-116388

Chain command blocks can clone themselves to create an infinite loop which freezes the server

XMLWordPrintable

    • Confirmed

      If a chain command block is set to clone itself into the block it's pointing at, it creates an infinite loop that freezes the server.

      To Reproduce:
      1. Place an impulse command block. Do not enter a command.
      2. Place a chain command block in front of it, facing horizontally.
      3. Enter one of these commands:
        /clone ~ ~ ~ ~ ~ ~ ~ ~ ~-1 (If block is facing north)
        /clone ~ ~ ~ ~ ~ ~ ~ ~ ~1  (If block is facing south)
        /clone ~ ~ ~ ~ ~ ~ ~1 ~ ~  (If block is facing east)
        /clone ~ ~ ~ ~ ~ ~ ~-1 ~ ~ (If block is facing west)
        

        into the chain block.

      4. Activate the impulse block.
      5. Notice that you cannot interact with entities, chunks don't load, attempting to close the game crashes it, etc.
      Reason:

      In 17w16a, Minecraft started using a new way of executing command blocks. Instead of registering every chain block to be ticked ahead of time, only impulse and repeating blocks are registered and execution follows the chain blocks.

      This means that if chain blocks are added during the tick they will be executed like normal, so by cloning themselves they can ensure that the chain never ends.

            searge [Mojang] Searge (Michael Stoyke)
            AjaxGb AjaxGb
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: