mojira.dev
MC-238959

Falling block placing at Y=1 changes into dropped item when landing on Y=0

The Bug
If you place a block which needs support below (e.g. sand, gravel, anvil, dragon egg and scaffolding) at the altitude Y=1 without supporting below, let it fall just 1 block and land on the altitude Y=0, it turns into an item instead of a block.

How to Reproduce

  1. Create a world in the current snapshot

  2. Go to the altitude Y=0

  3. Place such a block at Y=1

  4. When it lands on Y=0, you will notice that it turns into a dropped item

Attachments

Comments 9

I can confirm this. The expected behavior would be the falling blocks placed at y=1 would not get destroyed when landing at y=0.

Can confirm in 21w42a.

[media]

Confirmed in 21w43a (and I recall it happening in the v1.18 experimental snapshots as well).

Agreeing with Avoma's description of the intended behavior, as performing an experiment with Pistons at Y=0 and Y=-2 shows that gravity blocks falling to Y=1 and Y=-1 do not break.

Confirmed in 1.18-pre1.

Whats happens is basically, the falling block's position is set to -0.00000000000000002777 & Block position is calculated by flooring the position.
So instead of checking if it can land in air, it's checking if it can land in the block below.

Proof:
Create a superflat world
Teleport to [0,6,0]

Run `/fill 2 3 2 -2 0 -2 air`
Run `/fill -2 -1 2 2 -1 -2 bedrock`

Run `/summon minecraft:falling_block 0.4 1 0 {Time:1}` - Observer the bug happen

Run `/setblock 0 -1 0 minecraft:moving_piston `
Run `/summon minecraft:falling_block 0.4 1 0 {Time:1}` - Notice how its not despawning and never will

Falling blocks do not break when in a moving piston. Although this moving piston is 1 block below the falling block

The bug is that falling blocks at Y:0 have the incorrect position, since normal blocks that are flat on the ground stay at a perfect 0

This seems to be a Signed Zero bug + floating-point imprecision. So the solution is most likely to be deflating before reaching this point, so the deflating line is in the wrong position.

Still exists in 1.18-pre5.

I tried this with a full durability anvil.  It produces its breaking sounds when it turns into an item, but the anvil itself doesn't actually take damage.

@Sushi3462 Anvils don't take damage when they fall one block

Can confirm
Pre-release 5

Ultimus

Henning Erlandsen

Confirmed

Important

Block states

21w41a, 21w42a, 21w43a, 1.18 Pre-release 1, 1.18 Pre-release 5

1.18 Pre-release 6

Retrieved