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

/clone, /execute if blocks, and /fill have inconsistent behavior about chunk loading

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.14.4, 19w34a, 19w35a, 19w36a, 1.15.2, 20w08a, 20w09a, 20w10a, 20w11a, 20w12a, 20w14a, 20w16a, 20w17a, 20w18a, 20w20b, 1.16 Pre-release 5, 1.16.1, 1.16.2 Pre-release 1, 1.16.2, 1.16.3, 1.16.4 Pre-release 1, 1.16.4, 20w45a, 20w46a, 20w48a, 20w49a, 20w51a, 21w03a, 1.16.5, 21w19a, 1.17.1, 21w37a, 1.18.1, 1.19.1, 1.19.2, 22w42a, 1.19.3 Release Candidate 1, 1.19.3, 23w03a, 1.19.4, 23w18a, 1.20.1, 23w31a, 1.20.2
    • Confirmed
    • Chunk loading, Commands

      The bug

      • A. /clone checks whether the level has all the target chunks and fails if not.
      • B. /fill and /execute if blocks check only the begin and end chunks. These commands cause all the target chunks to be loaded temporarily as a side effect.

      These behaviors are inconsistent and should be unified into one of them.

      How to reproduce

      1. /forceload add 0 0
      2. /forceload add 1023 0
      3. /clone 0 0 0 1023 0 0 0 0 1

        That position is not loaded (A)

      4. /fill 0 0 0 1023 0 0 minecraft:stone destroy

        Successfully filled 1024 blocks (B)

      5. /execute if blocks 0 0 0 1023 0 0 0 0 0 all

        Test passed, count: 1024 (B)

      Code analysis

      /clone uses LevelReader#hasChunkAt to check the chunks.

      // net.minecraft.server.commands.CloneCommands#clone
      if (level.hasChunksAt(begin, end) && level.hasChunksAt(destinationBegin, destinationEnd)) {
          // ...
      } else {
          throw BlockPosArgument.ERROR_NOT_LOADED.create();
      }
      

      There are no preconditions like that in /fill or /execute if blocks.

            Unassigned Unassigned
            intsuc intsuc
            Votes:
            7 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              CHK: