mojira.dev
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"}{\code}

    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

Linked issues

Attachments

Comments 2

Thank you for your report!
After consideration, the issue is being closed as Invalid.

You have posted a feature request or a suggestion. This site is for bug reports only.
For suggestions, please visit The official Minecraft feedback site or visit the Minecraft Feedback Discord server.

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki

DorkOrc

(Unassigned)

Community Consensus

Block states, Commands

25w02a

Retrieved