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

Statistics tracking distance traveled with vehicle increase when mounting entity

    XMLWordPrintable

    Details

    • Confirmation Status:
      Confirmed
    • Category:
      (Unassigned)

      Description

      The bug

      When you right click on a boat to get in, the statistic minecraft.custom:minecraft.boat_one_cm increases based on how far away you were from the boat.

      How to reproduce

      1. Make a scoreboard with the minecraft.custom:minecraft.boat_one_cm statistic and set the display to the sidebar
        /scoreboard objectives add boat1cm minecraft.custom:minecraft.boat_one_cm
        /scoreboard objectives setdisplay sidebar boat1cm
      2. Get a boat, place it down and go in to it
        → As you can see, you haven't moved yet but the score has gone up with around 500 points

      The further you stand away as you click on the boat the more points you get.

      Code analysis

      Based on 1.11 decompiled using MCP 9.35 rc1

      The method net.minecraft.entity.player.EntityPlayer.addMountedMovementStat(double p_71015_1_, double p_71015_3_, double p_71015_5_) adds the distance the player moves when riding an entity. Since the player moved from where he was originally standing to now in the boat, the method sees this as moving the boat. This also occurs with minecarts, pigs, and horses.

      This could probably be fixed by having the method net.minecraft.entity.Entity.addPassenger(Entity) call the method net.minecraft.entity.Entity.updatePassenger(Entity) if it successfully added the passenger.

      Note: This would probably fix the bug that chicken jockeys start riding a chicken which has a block above it as well.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              tintin10 Quinten Cabo
            • Votes:
              3 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                CHK: