mojira.dev
MC-178666

Falling blocks can place themselves while riding an entity

If a falling block is riding an armor stand it can place itself on the ground if lined up on the y-axis correctly.
Summon an armor stand with a falling block passenger

/summon minecraft:armor_stand ~ ~ ~ {NoGravity:1b,Passengers:[{id:"minecraft:falling_block",BlockState:{Name:"minecraft:stone"},Time:1}]}
/execute align xyz run tp @e[type=armor_stand,sort=nearest,limit=1] ~0.5 ~-1.975000023841855 ~0.5

then teleport it to be lined up with the minecraft block grid and on the ground and it will place itself.

Linked issues

Comments 4

Can confirm in 20w51a.

Can confirm in 21w03a.

Since the height of armor stands was changed, the relative-y should be adjusted:

/execute align xyz run tp @e[type=armor_stand,sort=nearest,limit=1] ~0.5 ~-1.975000023841855 ~0.5

and the code analysis (decompiled 1.20.2 with vanilla mapping:

net.minecraft.world.entity.item.FallingBlockEntity.class

public void tick() {
    if (this.blockState.isAir()) {
        discard();
        return;
    } 
    Block $$0 = this.blockState.getBlock();
    this.time++;
    if (!isNoGravity()) setDeltaMovement(getDeltaMovement().add(0.0D, -0.04D, 0.0D)); 
    move(MoverType.SELF, getDeltaMovement());
    ...

It seems always to move regardless being passengers, cause the placement logic later goes wrong.

underminerman

(Unassigned)

Confirmed

Commands

1.15.2, 1.16.4, 20w51a, 21w03a, 1.20.2

Retrieved