The bug
As the title says, when attempting to create a moving_piston
block, the block entity is not created.
How to reproduce
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
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
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.
Confirmed for 1.13.1-pre1