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

Falling Block visual stuttering bug

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.21
    • None
    • Community Consensus
    • Entities
    • Normal
    • Platform

      COMMAND TO REPLICATE BUG HIGHLIGHTED AT THE BOTTOM

      There exists a bug in current versions of Minecraft affecting certain types of Falling Block entities, specifically those that have a "position offset" (example: flowers, pointed dripstone, short and tall grass, most foliage) determined by the XZ coordinates and the world seed. Though happening very rarely in vanilla, both in-game circumstances and commands can easily demonstrate this visual bug.

      broken.mp4

      When a Falling Block with a positional offset is spawned with or at any time during its fall is given (by tnt, a creeper, etc) enough horizontal velocity to cross the boundary into another XZ block position, the current rendering logic assumes that the Falling Block's visual offset must be updated to match its new position. This causes a horizontally moving pointed dripstone, for example, to stutter very jarringly along its trajectory. This "position offset" does not change along the Y axis which is why this bug can be difficult to spot in survival.

      The proper rendering implementation for this should be very easy to set up since Falling Block's already contain data of where they spawned initially, which can be used to maintain the proper offset for the entirety of its trajectory. That said, this bug emerges from two classes within the code; ModelBlockRenderer and FallingBlockRender. ModelBlockRenderer has a problematic implementation where both the lighting and "position offset" are handled using the same block position (or BlockPos). This means that if you attempt to simply fix the issue by changing the inputted BlockPos to where the Falling Block initially spawned, as mentioned before, it will cause the entity to permanently retain the lighting of its initial spawning position, causing it to appear extremely unnatural as it falls through different light levels below it.

      One way to address this is to allow the ModelBlockRenderer to accept an additional BlockPos object that contains the "position offset" data. That way both the lighting and offset data can be handled separately, since currently the logic that maintains proper lighting conversely breaks the offset rendering and vice versa. See: lighting_bug_example.mp4

       

      After both changes are implemented, here's how it should look!

      fixed.mp4

      -

      For the Mojang testers, you can easily confirm this bug for yourself by going into a 1.21 world with cheats and running:

      /summon falling_block ~1 ~ ~ {BlockState:{Name:"minecraft:pointed_dripstone"},Time:1,Motion:[1.0,1.0,0.0]}

      The entity will launch eastbound and you'll notice it stuttering as demonstrated.

        1. broken.mp4
          428 kB
        2. fixed.mp4
          375 kB
        3. lighting_bug_example.mp4
          7.77 MB

            Unassigned Unassigned
            reborn_team_ reborn_team_
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              CHK: