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

    Details

    • Type: Bug
    • Status: Open
    • Resolution: Unresolved
    • Affects Version/s: 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
    • Fix Version/s: None
    • Confirmation Status:
      Confirmed
    • Category:
      Chunk loading, Commands

      Description

      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 as a side effect by adding unknown tickets.

      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.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            intsuc intsuc
            Votes:
            3 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              CHK: