mojira.dev
MC-87652

Falling block entities' hitbox extends past its block

The bug

Falling block entities have server-side the default hitbox size (0.6 * 1.8) instead of 0.98 * 0.98 if the constructor with only a world parameter is called. This is the case in the following situations:

  • it is summoned (/summon)

  • it changes the dimension

  • it is loaded by a structure block

  • it is loaded from a save file

  • it is loaded as the vehicle of a player (RootVehicle)

  • it is spawned by a mob spawner

This can cause desync problems because the client uses the correct size.

How to reproduce

Collision with blocks

This can be reproduced when you try to move an affected falling block entity through gaps which are less than 1.8 block high.

/summon falling_block ~ ~1 ~ {Time:-2147483648,Motion:[1.0,0.2,0.0]}

In the attachment

[media]

, the redstone block gate only allows the falling_block through if the entity enters at the bottom part of it (having 2 blocks of vertical empty airspace) but not at the upper half where it only has one block of empty airspace.

Passenger offset

Passengers are offset based on the height of the ridden entity, therefor this bug causes a position desync for riding entities.

  1. Summon a shulker riding a falling block entity

    /summon falling_block ~ ~ ~ {NoGravity:1b,Time:-2147483648,Passengers:[{id:"shulker",NoAI:1b,NoGravity:1b}]}
  2. Stand on the shulker box
    → You will see that you are constantly moving up and down because server-side the shulker is higher and therefor the server thinks the client is moving invalid

Code analysis

Code analysis by @unknown can be found in this comment.

Linked issues

Attachments

Comments 13

A similar issue was fixed in 15w45a. Is this still an issue? If so, please explain the issue in detail and provide steps to reproduce it. Please also update the list of affected versions.

Please do not mark unreleased versions as affected.
You don't have access to them yet.

--- I am a robot. This action was performed automatically.

It is still an issue. I tried to make the GIF as self-explanatory as I could. When any FallingSand has horizontal velocity, it's stopped by blocks one block above it, or at equal elevation, as if the entity has a height of 2 blocks. In my case, I have command blocks running that summon FallingSand at the location of specific item entities; other than that there is only a particle effect that plays around the FallingSand. I just reproduced the same results with regular FallingSand with no additional attributes other than horizontal motion on a blank creative world with no command blocks. Despite the sand appearing to fly through the gate, or at least being able to fly through the gate, it's ultimately stopped at the point before going through said gate. It has no problems with the gate if the height the entity enters at means there is at least one block of empty space above it. So the gates portrayed in the GIF attachment would allow the FallingSand to pass through if the top parts of the gate were top-half-slabs.

In other words, at least to me, it strictly appears as if FallingSand entities have a height of 2 blocks.

Please provide the commands you are using.

This is the only necessary command since FallingSand doesn't naturally move horizontally unless by explosion or command. It's about the most basic it can be.

/summon FallingSand ~ ~1 ~ {Time:1s,Motion:[1.0,0.2,0.0]}

Any variation of the command doesn't matter; the block still won't pass through unless given at least 1x2x1 space.

In the GIF, the redstone block gate only allows the FallingSand through if the entity enters at the bottom part of it (having 2 blocks of vertical empty airspace) but not at the upper half where it only has one block of empty airspace.

Please link to this comment in the description

The following is based on a decompiled version of Minecraft 1.9 using MCP 9.24 beta.

The reason why this happens is like @unknown said, that the size of the FallingSand entity is not set when the constructor net.minecraft.entity.item.EntityFallingBlock.EntityFallingBlock(World) is called. This constructor is called when an entity is created based on the entity id only. FallingSand seems to be the only entity that is affected.

Confirmed for 1.13.2

Cannot reproduce in 20w30a. This has been fixed at some point by storing entity dimension information in the net.minecraft.world.entity.EntityType class (Mojang name).

Allen Taylor

(Unassigned)

Confirmed

(Unassigned)

/summon, collision-box, falling_block, hitbox, size

Minecraft 1.8.8, Minecraft 15w35e, Minecraft 15w45a, Minecraft 1.9, Minecraft 1.9.2, ..., Minecraft 18w48b, Minecraft 18w49a, Minecraft 18w50a, 1.14.4, 19w46b

Retrieved