Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-196243

Falling block entity is not consistently considered as obstruction

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Resolution: Unresolved
    • Affects Version/s: 20w30a
    • Fix Version/s: None
    • Labels:
      None
    • Confirmation Status:
      Unconfirmed
    • Category:
      Entities

      Description

      The bug

      Falling block entities (e.g. falling sand) are not consistently considered as obstruction, e.g. when determining whether the player may place a block at that location.

      A falling block entity which is created when a falling block without supporting block starts to fall down obstructs block placement.
      However, a falling block entity created in other situations is not considered an obstruction:

      • entity traveling through portal
      • entity created using /summon
      • entity created by mob spawner
      • ...

      Considerations

      There might datapacks which rely on this behavior?

      Reproduction steps

      1. Let a falling block (e.g. sand) fall on cobweb
      2. While it is slowly falling down, try placing a block with collision box (e.g. stone) intersecting with the upper half of the falling block entity
        As expected the falling block entity prevents placement of the block
      3. Summon a falling block entity
        /summon falling_block ~ ~0.01 ~ {NoGravity:1b,Time:-2147483648}
        
      4. Try placing a block with collision box (e.g. stone) intersecting with it
        The block can be placed even though it intersects with the falling block entity

      Code analysis

      Mojang names

      For all other entities which count as obstruction the field blocksBuilding is assigned a value in the (EntityType, Level) constructor to which all other constructors delegate. However, for net.minecraft.world.entity.item.FallingBlockEntity it is assigned in the other constructor.
      To prevent issues like this in the future it would make sense to store this information in EntityType, similar to how it was done for the entity size which fixed MC-87652.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              marcono1234 [Mod] Marcono1234
              Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated: