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

Caves & Cliffs Advancement is inconsistent due to incorrect fall distance calculation

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.19, 1.20.1, 1.20.4
    • None
    • Windows 10, Java 17
    • Community Consensus
    • Advancements
    • Low
    • Gameplay

      In 1.18.2 and 1.19, the Caves & Cliffs advancement for falling from the top of the world to the bottom is inconsistent, specifically when falling into water. For example, when standing with your feet at y=320, jumping, and falling into a water source block landing with your feet at anywhere between -59 to -62, you will not get the advancement. Another example is when standing on a fence gate with your feet at y=320.5, not jumping, opening the fence gate and falling into a water source block landing with your feet at y=-60, you will not get the advancement; but if you do the same fall and land on a waterlogged slab at y=-59.5 you will get the advancement, even though the fall distance was shorter.

      The main cause for this is that when falling into water or onto a fall-damage-resetting block, the advancement check is triggered (when fall distance is reset) before the player is actually moved during the tick. See the following screenshot of an annotated code snippet from Entity.move:

      Effectively, the advancement is looking at what the player's position was in the previous tick. Because at this point the player is falling at around 3.7 blocks/tick, the position used to check the advancement is often above -59, meaning the player will not receive the advancement. If the position was updated before fall distance was reset instead of after, I believe the advancement would function reliably and consistenly.

      I'm attaching the world file I used to test various landing positions, starting positions (eg jumping or not, standing on a fence gate to increase position by 0.5 blocks), as well as a very simple Fabric mod I made that logs the fall distance (immediately before the Caves&Cliffs advancement would trigger) whenever falling over 100 blocks (or exactly 0 blocks, which i think means that it was triggered again in the same game tick after fall damage was already reset). Note the issue appears in vanilla minecraft, I just made the mod to confirm that the values being used to check the advancement were incorrect. The mod works on both 1.18.2 and 1.19.

      There is also a second minor issue with Caves & Cliffs: the starting falling position is only set the tick after beginning to fall, and so the calculated falling distance is slightly lower than the actual falling distance. This means falling from (for example) 319.0625 (standing on a carpet) to -60 (not landing in water, either using a totem of undying or just creative mode), will not give you the advancement even though you fell more than 379 blocks. However I don't think this second problem is serious, i just wanted to mention it for completeness.

            Unassigned Unassigned
            Vasher_MC Vasher_MC
            Votes:
            6 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              CHK: