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

Arrows with negative damage can crash the game on hitting an enemy

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Cannot Reproduce
    • Affects Version/s: Minecraft 15w35e, Minecraft 15w47c, Minecraft 1.8.9, Minecraft 15w51b, Minecraft 1.10.2, Minecraft 16w41a, Minecraft 16w42a, Minecraft 1.11, Minecraft 16w50a, Minecraft 1.11.1, Minecraft 1.11.2, Minecraft 1.12.2, Minecraft 17w50a, Minecraft 1.13, Minecraft 1.13.1-pre1, Minecraft 1.13.1-pre2, Minecraft 1.13.1, Minecraft 18w47b, Minecraft 1.14.2
    • Fix Version/s: None
    • Labels:
    • Confirmation Status:
      Confirmed
    • Category:
      (Unassigned)

      Description

      Arrows with negative damage can crash the game on hitting an enemy.

      This crash is strange, because crash seems to be dependent both on just how negative the damage is, and on the distance from player to the hit mob.

      How to Reproduce:

      1. Place an Always Active Repeat Command Block anywhere in the world with the following command inside:

      execute as @e[type=arrow] run data merge entity @s {damage:Xf}
      

      The exact value of X determines if the game will crash.

      2. Place and immobilize two Villagers, one 5 blocks away from the player, second around 25 blocks away.

      3. Shoot a villager with the bow. Be sure that the arrow will be in the air for at least one tick for the command to work.

      4. Depending on the value of X and which Villager you shoot, the following things should happen:

      X = -1.0:
      Near Villager: Game Doesn't Crash
      Far Villager: Game Doesn't Crash

      X = -1.4:
      Near Villager: Game Crashes
      Far Villager: Game Doesn't Crash

      X = -1.5:
      Near Villager: Game Crashes
      Far Villager: Game Crashes

      For all X lower than -1.5, game always crashes on hitting any of the villagers.

      Description: Ticking entity
      
      java.lang.IllegalArgumentException: bound must be positive
      	at java.util.Random.nextInt(Random.java:388)
      	at aoj.b(SourceFile:368)
      	at aoj.a(SourceFile:335)
      	at aoj.R_(SourceFile:264)
      	at aol.R_(SourceFile:99)
      	at axx.a(SourceFile:1243)
      	at td.a(SourceFile:575)
      	at axx.g(SourceFile:1218)
      	at axx.o_(SourceFile:1100)
      	at td.o_(SourceFile:491)
      	at net.minecraft.server.MinecraftServer.b(SourceFile:755)
      	at net.minecraft.server.MinecraftServer.a(SourceFile:681)
      	at dgg.a(SourceFile:131)
      	at net.minecraft.server.MinecraftServer.run(SourceFile:584)
      	at java.lang.Thread.run(Thread.java:745)
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              RedSpah RedSpah
              Votes:
              11 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                CHK: