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

Fall distance is not updated on the last tick of the fall

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Awaiting Response
    • None
    • Minecraft 1.12.2, Minecraft 1.13, Minecraft 18w30a
    • None
    • Unconfirmed
    • (Unassigned)

      The updateFallState does not add -y to the fall distance on the last tick of the block, when the player touches the ground, causing the fall distance to be slightly less than it actually is:

      protected void updateFallState(double y, boolean onGroundIn, IBlockState state, BlockPos pos)
      {
          if (onGroundIn)
          {
              if (this.fallDistance > 0.0F)
              {
                  state.getBlock().onFallenUpon(this.world, pos, this, this.fallDistance);
              }
      
              this.fallDistance = 0.0F;
          }
          else if (y < 0.0D)
          {
              this.fallDistance = (float)((double)this.fallDistance - y);
          }
      }
      

      The "else if (y < 0.0D)" should instead be an if statement and moved to the start of the method.

            Unassigned Unassigned
            runemoro Runemoro
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: