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

The distances some entities travel are miscalculated

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.20.4, 24w06a, 24w07a, 24w11a, 24w12a, 24w13a, 24w14a, 1.20.5 Pre-Release 1, 1.20.5 Pre-Release 3, 1.20.5 Pre-Release 4, 1.20.5, 1.20.6 Release Candidate 1, 1.20.6
    • Confirmed
    • (Unassigned)

      The distances some entities travel seem to be wrongly calculated. The affected entities (that I found) include Primed TNTs, Falling Blocks, Players, Items and most mobs. Unaffected entities include Snowballs, Arrows and Boats. Instead of following the equation s=vt (where s is the distance the entity travels in one game tick, v is the velocity of the entity in that game tick, t=0.05 seconds which is 1 tick), it seems like s=kvt, where k is a constant that roughly equals 1.020.

      Steps to reproduce

      1. Teleport yourself to a high place: /tp @s ~ 300 ~
      2. Summon a primed TNT entity with a very long fuse (so it doesn't explode): /summon tnt ~ ~ ~ {fuse:30000}
      3. Freeze the game: /tick freeze
      4. Get the y-coord of the TNT in millimeters: /data get entity @e[type=tnt,limit=1,sort=nearest] Pos[1] 1000
      5. Step 1 tick: /tick step 1t
      6. Get the velocity of the TNT in millimeters per second: /data get entity @e[type=tnt,limit=1,sort=nearest] Motion[1] -20000
      7. Repeat step 4
      8. (x)When you multiply the velocity in step 6 by 0.05 seconds, you don't get the difference of the two y-coords in steps 4&7

      In the video, I summoned a TNT with an initial velocity of 39.2m/s (downward). This is its terminal velocity, which is the velocity that makes its gravity and air friction entirely cancel out, so its velocity is always 39.2m/s. It should move 39.2m/s*0.05s=1.96m in one tick, but it moved 2.00m. Ignore the scoreboard in the video.

            Unassigned Unassigned
            2511425938514 Yellow25114
            Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              CHK: