mojira.dev
MC-119369

Boats crash/break and can kill their passengers when falling certain distances

The bug

When a boat or raft (with or without chest) falls for certain distances, it crashes when hitting the floor, breaks, and drops three planks and two sticks.

This is known to happen when falling exactly 12, 13, 49, 51, 111, 114, 198, 202, 310 or 315 blocks.

Additionally, for some distances, all passengers in the boat die instead of the fall damage being negated as usual. A passenger inside of the boat makes this bug less reliable to reproduce.

To reproduce

  1. On a flat surface, run /setblock ~ ~48 ~ stone

  2. /tp @s ~ ~49 ~

  3. Place a boat on the stone block

  4. Enter the boat

  5. Switch into survival mode

  6. Press forward
    → ❌ You die and the boat breaks

It is also possible to reproduce this by breaking the block below the boat instead of driving it off.

Notes

  • For some heights, no fall damage is dealt.

  • For some heights, the boat only breaks when dismounting it.

  • For boats with chests, the inside contents are destroyed (MC-249501).

Videos

Code analysis

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

Related issues

MC-122968 A boat drops wood and sticks if you let it drop 12 or 13 blocks MC-133379 Boat Crash and Break in 1.12.2 MC-168226 Boat breaks into 3 wooden planks and 2 sticks after being rowed off of a block. MC-180081 Teleported Invulnerable Boats still Breakable from Fall Damage MC-198917 Boat Breaks After Falling Under Certain Condition MC-199299 Old boat drops. MC-200516 Boats collapse at a certain height MC-201158 Boats break into planks and sticks when crashing from certain heights MC-205595 Instant death in a boat. MC-207898 Falling off 49 blocks in a boat kills you MC-208793 Oak boat breaks into planks and sticks MC-210854 Boats break into planks and sticks when break from fall damage MC-211440 boat breaks like in older versions (into planks and sticks) MC-224667 Boats that hit the edge of soul soil turn into planks and sticks MC-226148 Boat drops sticks and planks instead of the boat item MC-228461 boat falls trough ground and breaks leaving the old 2 sticks and 3 planks MC-229086 Boat disappear if falling and kill the player MC-230242 boat breaking like before 1.8.2 MC-232693 Boats turn into planks MC-235546 Boat bug on slime blocks MC-238397 i got wood and sticks from my boat when it broke MC-258958 Boat didn't nullify fall damage when landing on stairs MC-265196 boat MC-265674 Minecraft Boats still somehow break into sticks and planks MC-270380 boat breaking after rowing off platform and punching it with an iron axe MC-270382 Boats are breaking MC-270913 Boat/raft falls then breaks unexpectedly MC-274861 Boats launched from slimes bounce in mid air. MC-276511 Boat disintegrate up into bars and planks when flying after hitting a wind charge

Comments

Uriel Salischiker

Cannot recreate, dropped 49 blocks, 48 blocks and 53 blocks and the boat didnt break on survival

Can you provide more reproduction steps?

migrated

@Urielsalis Make a platform at y=113, and another at y=64 slightly away from it, then ride a boat (survival) from the top to the bottom one. The boat breaks, and you take fall damage

Uriel Salischiker

Making a platform in a superflat world with those exact coordinates worked, adding a extra block or removing one makes the boat not break

migrated

I could recreate it just by stacking up 49 blocks!

migrated

Confirmed in 18w10d

migrated

Also breaks falling block 179 to 64.

migrated

again in 19w37a,
I have some details:
In a command block, you can summon a boat
summon minecraft:boat ~ ~y ~
where y = 12.5, 13.5, 49.5, 51.5, 111.5, 114.5, 198.5 or 202.5 (work with a tower)
(0.5 because a command block summon in the middle of a block)
Or you can run /data modify entity @e[type=boat,sort=nearest,limit=1] Motion[1] set value 1.0
(1.0 corresponds to 13 blocks, and 0.9 to 12)

dianliang233

Confirmed in 1.16.2

migrated

Notably, the boat breaks into 3 planks and 2 sticks like before 1.3.1. Might be somewhat related to MC-89954  - should boats even break like that at all?

 

The height appears to correspond to ((5x)²±x)/2

migrated

I tested this after seeing a reddit post on this bug.   I was able to reproduce it in 1.16.3 when falling from exactly 49 blocks, the player dies and the boat breaks into planks & sticks.

migrated

I saw the same Reddit post and decided to investigate. I skimmed MCP 1.12 because I still have it lying around and that version is affected.

In what it calls EntityBoat’s updateFallState, if the boat’s status is not ON_LAND, fall damage is nullified. That will be the case when falling from most heights, because the last time the boat’s status was updated was before it hit the ground. There is only a small exception because the boat checks blocks up to a thousandth of a block below it when updating its status. If it ends up just barely above the ground, its status becomes ON_LAND before hitting the ground, allowing fall damage to take effect.

This happens at the given heights because gravity subtracts 0.04F from the boat’s Y velocity. If it were exactly 0.04, the boat would have fallen an integral number of blocks every 2 ticks out of 25: 12, 13; 49, 51; 111, 114; 198, 202; and so on. The boat ends up falling very slightly less than that because 0.04F is rounded down as a 32-bit float, placing it just above the ground and allowing it to become ON_LAND before hitting it.

Avoma

Can confirm in 21w03a.

Avoma

Can confirm in 21w05b.

migrated

have done the math behind this and the numbers are matching up to a pattern, however for some reason 12 and 13 aren't breaking the boat (at least for me). If the World height increases the chance the next two numbers that will cause this are 310 and 315. I assume this is more of an issue with JAVA than with Minecraft, however you could possible make a "fix" by making the boats invulnerable in a way at these numbers.

Avoma

Can confirm in 21w06a.

migrated

Can confirm in 21w07a.

migrated

Can confirm in 21w10a.

migrated

Can confirm in 21w20a

migrated

Can confirm in 1.17-pre1.

ampolive

Can confirm in 1.17.1 Release Candidate 2.

migrated

works in 1.17.1

ampolive

Can confirm in 1.17.1.

Avoma

Can confirm in 21w41a.

ampolive

Can confirm in 21w44a.

Avoma

I can also confirm this behavior in 1.18.1.

Here's a code analysis of this issue. The following is based on a decompiled version of Minecraft 1.18.1 using MCP-Reborn. Please note that I'm quite tentative about this analysis, although I'm persuaded to believe that this is likely the cause of the problem. 🙂

Code Analysis (tentative):

net.minecraft.world.entity.vehicle.Boat.java

public class Boat extends Entity {
   ...
   protected void checkFallDamage(double p_38307_, boolean p_38308_, BlockState p_38309_, BlockPos p_38310_) {
      this.lastYd = this.getDeltaMovement().y;
      if (!this.isPassenger()) {
         if (p_38308_) {
            if (this.fallDistance > 3.0F) {
               if (this.status != Boat.Status.ON_LAND) {
                  this.resetFallDistance();
                  return;
               }

               this.causeFallDamage(this.fallDistance, 1.0F, DamageSource.FALL);
               if (!this.level.isClientSide && !this.isRemoved()) {
                  this.kill();
                  if (this.level.getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS)) {
                     for(int i = 0; i < 3; ++i) {
                        this.spawnAtLocation(this.getBoatType().getPlanks());
                     }

                     for(int j = 0; j < 2; ++j) {
                        this.spawnAtLocation(Items.STICK);
                     }
                  }
               }
            }

            this.resetFallDistance();
         } else if (!this.level.getFluidState(this.blockPosition().below()).is(FluidTags.WATER) && p_38307_ < 0.0D) {
            this.fallDistance = (float)((double)this.fallDistance - p_38307_);
         }

      }
   }
   ...

It's intended behavior that boats can prevent fall damage when riding them as stated in MC-105103, and the assigned "Mojang Priority" of this ticket (MC-119369) implies that boats should not occasionally be able to break into sticks and planks, however, if we look at the above class, we can see that checks are specifically carried out to make them behave this way, resulting in this problem occurring.

[Mod] ManosSef

Can confirm in 22w12a. Additionally, if this issue affects a boat with a chest, the chest's contents disappear entirely from the world.

ampolive

@unknown That might be worth a separate report.

migrated

Boats with chests was already added here, ampolive, and fixing this resolves that (and this has priority, so not intended to happen).

ampolive

I will just add that to the description then.
Edit: well, that was reported as a separate issue anyway (MC-249501).

windwend

The presence of MC-249501 definitely makes this issue more important to fix. Boats breaking and players dying from fall damage are acceptable risks, but losing all items in a boat with chest is much more punishing in comparison, especially since MC-105103 is intended.

muzikbike

Boats can also break like this when driven out of the world border.

Qcom

Decimal heights at which boats fall and break are given by the equation x(x+1)/50.

Avoma

Can confirm in 1.19.

migrated

confirmed in 1.19, but doesnt work on 12 or 13 blocks. havent tested other heights except 49 blocks yet. Also, I dont die from the fall, as suggested in the description.

GrantGryczan

@railgun290 12 (and probably 13) blocks works fine for me in 1.19.2 if I'm not in the boat when it falls.

migrated

Can confirm in 1.19.2.

If a player is in the boat, it doesn't break for 12 and 13 blocks. I have tested 49 blocks and the boat break (the player die too).

For 12 or 13 blocks, the boat break when (no player in the boat) :

  • breaking the block below (12 blocks high)

  • pushing the boat with a piston horizontally (12 blocks 

  • setting the y motion to certain values :

/execute as @e[type=boat,distance=..5] run data modify entity @s Motion[1] set value 0.6

 

mattp12

Can confirm for 22w42a.

Also happens with rafts.

Bry10022

Can confirm this happening on 1.19.51 on Bedrock. I do not see any logical reason for this to be happening

Avoma

@unknown, this is the Java Edition issue tracker used for exclusively tracking Java Edition bugs. Please head over to the MCPE (Bedrock Edition) tracker and address the problem accordingly over there if it hasn't already been reported yet. 🙂

migrated

Can confirm in 1.19.3

Brain81505

Can confirm in 23w03a

Brain81505

Can confirm in 1.19.4

magicus

I was intrigued by this. Adding to @Avoma's analysis, the problem is that there is a discrepancy between the 
onGround argument, which is true when the boat has landed, and this.status. The status is updated every tick, to either IN_AIR or ON_LAND (for the relevant problem; other values are possible otherwise).

So most of the time, we're entering checkFallDamage with onGround true, and the boat's status says it is in the air, so we reset the fall distance and do nothing else. But due to timing, in some situations the tick update has managed to set our status to ON_LAND, and we go on to do the "deal damage to passengers, replace boat with planks and sticks".

The correlation with heights is therefore more incidental; the real cause of when this happens is how the call to checkFallDamage correlates to how the last tick has set the status to ON_LAND.

magicus

The solution though, seems simple enough. The replacement of the boat with planks and sticks is a remnant from a very old behavior. There is no need to check anything else apart from the onGround argument, and then always reset the fall distance, regardless of the value of this.status.

One could hope that a Minecraft engineer gets to spend a few minutes on fixing this.

migrated

Can confirm in 1.20, just died to it 😞

naista2002

Appears to be still an issue in 1.20.1, though my case specifically didn't have my boat (spruce boat with chest to be specific) fall as such. I rowed my boat at a high speed onto a "boat gate" which detects the boat using tripwire and pushes it up with a piston and a block of packed ice so it can move across the frozen river. Once the piston fired, the boat glitched into ice and broke into planks and sticks a few moments later.

naista2002

Definitely still an issue in 1.20.1. I've tested it on a sandbox using pistons to push the boat off certain heights (tested with 12, 13, 49, 51 blocks). Curiously, the boat only breaks when a mob (tested on husks, pigs and chickens) is inside, but it doesn't when only boarded by the player. If both the player and a mob are inside, the boat breaks only after the player exits it. In all tested cases, the mob receives fall damage (unless it's unable to, as with chickens), but the player doesn't, even in Survival.

Also, the boat breaks and the mob inside breaks its limbs before it actually lands; for a 51-block fall it happens around 15-20 blocks above the ground.

UPD: If I recall correctly, when the boat glitched through a moved block (see my previous comment), I quickly dismounted the vehicle, and only then did it break. I've quickly tried pushing an empty boat, and it likewise broke. Once again, it didn't break when the player was inside, nor did it break once the player left it after landing.

KeqiaoNana

It also happened in my world. Howerer the altitude difference was far lower than 12. Maybe that's a decimal.

Auldrick

A full mathematical analysis explaining why this happens is presented on the YT channel Stand-up Maths in this video.

Bry10022

This does not appear to be occurring on 24w13a for me…

Johnden

Cannot reproduce as well in 24w13a

ampolive

I am not able to reproduce in 24w13a if I'm inside the boat, but I am able to reproduce this by summoning a boat 12 blocks above the ground, so the core issue isn't fixed.

migrated

Hey ampolive! I helped Matt (who made the video) with testing this and understanding the decompiled code. As you mentioned, the easiest way to reproduce is using the summon command or placing a boat on a floating block and breaking it, without riding as a passenger. Vehicle mechanics when there’s a passenger seem to change things, but I could still cause player damage when riding the boat if it was dropped from 49 or 51 blocks - and then I moved forward a little on the ground or dismounted, depending on the version.

I haven’t tried in the latest snapshot but if nobody beats me (I’m sure they will!) I can try some of these variants and report back tomorrow.

migrated

Please someone explain the code to me , its driving me crazy.

in this line
this.status != Boat.Status.ON_LAND
this.status is referring to the player right ? what i dont understand is that when the player is on the ground it would continue and deal damage and when he is in the air it would reset the fall distance, why is the condition with boat.status.ON_LAND, why not just ON_LAND or boat.status? what is p_38308_ ?, why is it checking if the player is on the boat?
if (!this.isPassenger()

 

when is  CheckFallDamage called?

why does this even exist if boats or players shouldn't even take damage from falling.

just add a condition that if the player is on a boat he doesn't take damage from falling
 

migrated

Can reproduce in 1.20.4, from these heights:

49 blocks - inside and outside

12 blocks - outside, but not inside

migrated

I found it also works when boat is pushed up by piston into string connected to tripwire hook and then it slowly falls and breaks.

migrated

Just in case people havent seen yet, theres an in depth explanation on the youtube channel:
Stand-up Maths
I will shortly explain here as well. The problem occurs because of the way gravity works in minecraft, you fall 0.04 block/tick^2, which means every second your falling speed increases with 0.04 blocks, however, since values are stored differently when it comes to computers its actually 0.03999999910563 or something like that, i dont remember the exact number, however the point is that the part of the code that checks for fall damage is now seeing, that even though, to you, you are in the air, according to the code, you are very close to a block which the code sees as actually hitting a block and so you will take fall damage. I highly recommend watching Stand-up Maths video for a more visual and better explanation.
In short it might be smart to add a condition that checks if you are in a boat and then doesnt do checkfalldamage.

Else you need to rethink the way checkfalldamage works.

Or one more solution may be to change the gravity acceleration value to something that can be stored as its actual value, this wouldnt really be noticeable.

BugTracker

Also affects 24w14a.

migrated

As AlexHolmbrg commented, there's two easy solutions. This should be fixed quick: Don't check fall damage if on boat. Also change gravity value to a number that doesn't need to be rounded for better code and less problems like this in the future

diskria

I noticed that with this bug, not only do I get fall damage, but my boat breaks into planks and sticks. um... is this vanilla behavior? I know that this could happen on very old versions, but now this is impossible, the boat only can burn out in lava or drop as an boat item, but it cannot break into planks and sticks! It seems to me that this is not a bug, but the developers forgot to remove some old code...

diskria

Also affects in 1.21-pre1

diskria

How MC-249501 has been fixed without fix of this? Why did they take on that bug almost instantly, but didn’t even notice that STR was based on another bug? And why weren't both fixed?

I’m completely confused because I’m following what the developers are fixing for 1.21: they fixed two bugs related to The End dimension. I don't understand this at all. Why fix these things in The End is prioritized if players are more likely to use the boat than go to The End dimension?

CaN2crow987

Can confirm in 1.21

Minecraft386882

I think it works as intended. 

[Mod] ManosSef

I can only reproduce this in 1.21 by dropping a boat from 12 or 13 blocks, not any of the other heights, and not while a player is inside the boat.

migrated

Alex's comment from April 4 can be expanded on, but I'm not sure this idea will work: A game tick is .05s, but the velocity is .04s / t2. If you changed the velocity to .05, would that resolve the floating point issue?

Bluebird

New reproduce steps for 1.21+ now that it only breaks at 12 or 13 blocks and not when a player is in the boat

To reproduce

  1. On a flat surface, run /summon boat ~ ~12 ~

  2. Move out of the way of the boat
    → ❌ The boat breaks

migrated

(Unassigned)

1256321

Confirmed

Platform

Normal

Collision, Entities

boat, boat-with-chest

Minecraft 1.12, Minecraft 17w31a, Minecraft 1.12.1 Pre-Release 1, Minecraft 1.12.1, Minecraft 1.12.2 Pre-Release 1, ..., 24w13a, 1.20.5, 1.21 Pre-Release 1, 1.21, 24w36a

24w37a

Retrieved