mojira.dev
MC-143265

Command blocks reevaluate maxCommandChainLength for warning message when chain is stopped

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)

Linked issues

Comments 0

No comments.

Marcono1234

(Unassigned)

Confirmed

Commands

maxCommandChainLength

Minecraft 19w04b, 20w13b, 23w41a

Retrieved