Mojira Archive
MC-279455

Using /setblock to replace a command block with a new one that is Always Active does not run the command in the command block

With the latest change to the behaviour of /setblock to successfully replace and recreate the block entity of blocks set with their NBT data specified, one would expect that replacing a command block with a new one should cause the block entity to run the command as if placed normally. (It should behave in the same way that using /setblock on any other block would)

Steps to Reproduce:

  1. Open a world in 25w02a and run the command
    /setblock ~1 ~ ~ command_block{auto:1b,Command:"/say hi"}
    1. Observation: The command block runs /say hi correctly.
  2. While in the same location, run the same command again.
    1. Observation: The command is successful, but the command block does not run its command.

Observed Result:

The command block runs when set on a non-command_block block, but does not run when replacing a command_block block.

Expected Result:

The command block should run its command instantly when set with /setblock or /fill, regardless of if it is replacing another command_block block

Invalid

DorkOrc

2025-01-14, 05:43 AM

2025-01-15, 08:07 AM

2025-01-15, 08:07 AM

1

2

Community Consensus

Block states, Commands

25w02a

-