mojira.dev
MC-253212

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

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:

[media]

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.

Attachments

Comments 7

An attachment with a disallowed file extension has been removed from this ticket.

Executable files and documents are not allowed as attachments.
Please attach crash reports, log files and screenshots as they are instead of pasting them into a document.
-- I am a bot. This action was performed automatically! If you think it was incorrect, please notify us on Discord or Reddit

Should I re-add a zip of the mod? or maybe just a zip of the source code? it was very helpful for me to be able to see the coordinates when the advancement was potentially being triggered, but i guess it may not be necessary if you can debug the game code itself easily

Perhaps you could upload the mod elsewhere and link it here, but it may be better not to provide it anyway, to avoid any potential malware.

Affects 1.20.4

Custom advancements that use fall_from_height trigger also do not work. For example "Dive Bomb" from BlazeandCave's

Have observed advancement failing to activate in 1.20.6, attributing it to this bug as I see no other open bug reports reporting issues with this advancement,

feel like its a shame that an advancement not working for most people for almost 2 years is marked as low priority, hoping this at least gets confirmed status soon

I re-tested this issue (with the attached testing world) in snapshot 25w02a, due to the promising-seeming fix of MC-167125 (another issue related to fall distance/fall damage), but unfortunately it seems that this issue is still present and has not been fixed yet.

Vasher_MC

(Unassigned)

Community Consensus

Gameplay

Low

Advancements

1.19, 1.20.1, 1.20.4, 1.20.6

Retrieved