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

Command blocks reevaluate maxCommandChainLength for warning message when chain is stopped

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • Minecraft 19w04b, 20w13b, 23w41a
    • Confirmed
    • Commands

      The bug

      Chain command blocks only consider the value of the gamerule maxCommandChainLength when the chain starts, but ignore any changes to it while the chain is running. This is intended, see MC-124447.

      However, when the chain is stopped because the limit is reached, the gamerule value is reevaluated for the warning message. This can create incorrect warning messages.

      How to reproduce

      1. Place empty impluse command block
      2. Place always active unconditional chain command block behind it
        gamerule maxCommandChainLength 65536
        
      3. Place always active unconditional chain command block behind it
        say Does not run
        
      4. Decrease maxCommandChainLength
        /gamerule maxCommandChainLength 1
        
      5. Activate the impulse command block from step 1
      6. Look at the log files
        It uses the new value for the warning message: "Command Block chain tried to execute more than 65536 steps!" (should have been "1 steps")

      Code analysis

      See net.minecraft.block.BlockCommandBlock.executeChain(World, BlockPos, EnumFacing) (MCP name)

            Unassigned Unassigned
            marcono1234 Marcono1234
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              CHK: