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

IllegalArgumentException when being attacked by a weak iron golem

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 19w41a
    • 19w35a, 19w36a, 19w40a
    • None
    • Confirmed
    • Crash
    • Normal

      The bug

      If an iron golem has high weakness level and if it hits you the game crashes.

      To reproduce

      1. Spawn an iron golem
      2. Give it weakness or strength effect lvl 2 or above
      3. Hit it
      4. Wait until it hits you

      Or spawn an iron golem using command:

      /summon iron_golem ~ ~ ~ {Attributes:[{Name:generic.AttackDamage,Base:0.0}]}
      

      and hit it

      Crash report

      Description: Ticking entity
      
      java.lang.IllegalArgumentException: bound must be positive
      	at java.base/java.util.Random.nextInt(Random.java:388)
      	at asj.C(SourceFile:154)
      	at aon.a(SourceFile:139)
      	at aon.e(SourceFile:131)
      	at apt.e(SourceFile:55)
      	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
      	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
      	at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
      	at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
      	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
      	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
      	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
      	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
      	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
      	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
      	at aof.a(SourceFile:80)
      	at ajy.dh(SourceFile:623)
      	at ajx.k(SourceFile:2275)
      	at ajy.k(SourceFile:487)
      	at asj.k(SourceFile:103)
      	at ajx.h(SourceFile:2120)
      	at ajy.h(SourceFile:294)
      	at wj.a(SourceFile:596)
      	at biv.a(SourceFile:656)
      	at wj.a(SourceFile:399)
      	at net.minecraft.server.MinecraftServer.b(SourceFile:836)
      	at net.minecraft.server.MinecraftServer.a(SourceFile:775)
      	at ebv.a(SourceFile:128)
      	at net.minecraft.server.MinecraftServer.run(SourceFile:643)
      	at java.base/java.lang.Thread.run(Thread.java:835)
      

            slicedlime [Mojang] slicedlime
            adnandakir adnan dakir
            Votes:
            3 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: