mojira.dev
MC-129017

Commands and structure blocks cannot properly create a moving piston block (no block entity created)

The bug

As the title says, when attempting to create a moving_piston block, the block entity is not created.

How to reproduce

  1. Type

    setblock ~ ~ ~ minecraft:moving_piston

    → Now the command can be run without NBT data

    → See it also suggests adding NBT data by suggesting the { character

  2. Finish the command:

    setblock ~ ~ ~ minecraft:moving_piston{blockState:{Name:"minecraft:piston_head",Properties:{facing:"south",short:"false",type:"normal"}},facing:3,progress:0.0f,source:1b,extending:1b}

    → It says the block has been placed, but there's nothing visible

  3. Type

    /data get block ~ ~ ~

    → It says the target block is not a block entity, and using the previous command in the same spot says it could not set the block. Note: using that same command on a moving block created by a piston does return the block entity

Affected methods

  • setblock

  • fill

  • clone

  • structure loading

Code analysis

Using MCP 1.12 names:

The tab-complete suggestion for NBT data occurs due to net.minecraft.block.Block.hasTileEntity() method returning true for the net.minecraft.block.BlockPistonMoving block. However, the block entity itself is not created because net.minecraft.block.BlockPistonMoving.createNewTileEntity() returns null.

Linked issues

Attachments

Comments 6

Confirmed for 1.13.1-pre1

Confirmed for 1.16.1; if Asteraoth doesn't oppose, I'd like to be the reporter again.

Can confirm in 21w20a

Can confirm in 1.18.2 if the following command is valid:

/setblock ~ ~ ~ minecraft:moving_piston{blockState:[{Name:"minecraft:red_stained_glass"}],progress:1.0}

We’ve encountered the issue with Cloning Active Flying Machines in the latest version, and it remains unresolved in v1.21.10. We opened a new ticket, but were directed here to the main one.

Below are the detailed reproduction steps along with an image of the bug. For the full reproduction video demonstrating how the issue occurs, please refer to the new ticket we opened.

MC-302629 :

Steps To Reproduce:

  1. Create a new Creative world with default settings.

  2. Build a simple flying machine using 2 sticky pistons, 2 slime blocks, and 1 observer.

  3. Use the command '/clone' to clone the flying machine using the format: /clone <x1> <y1> <z1> <x2> <y2> <z2> <x> <y> <z> where x1 y1 z1 are the starting obsidian corner coordinates, x2 y2 z2 are the ending obsidian corner coordinates, and x y z are the clone destination coordinates.

  4. Activate the initial flying machine to ensure it operates correctly.

  5. Once the machine is flying, enter the /clone <x1> <y1> <z1> <x2> <y2> <z2> <x> <y> <z> command that was executed above.

  6. Walk through the area where the parts disappeared for the cloned flying machine.

Observed Behavior
When a player clones a flying machine in Minecraft, certain components of the machine may fail to replicate correctly, resulting in their disappearance. Specifically, parts of the flying machine, such as pistons or slime blocks, may not appear in the cloned structure.|

Expected Behavior:
When cloning a flying machine in Minecraft, all components of the machine should be duplicated accurately without any parts disappearing. The cloned flying machine should function identically to the original, allowing players to interact with all blocks within the machine's structure as intended.

Screenshot 2025-10-08 at 12.01.39.png

Yes the issue remains in v1.21.10

user-f2760

(Unassigned)

Confirmed

Platform

Normal

Commands

Minecraft 14w21b, Minecraft 1.10.2, Minecraft 1.12.2, Minecraft 18w02a, Minecraft 18w16a, ..., 1.19.4, 1.20.1, 1.20.2, 23w43b, 1.21.10

Retrieved