Mojira Archive
MC-212520

Crash servers with bane of arthropods level 0 bow

The bug

There are bows with bane of arthropods level 0 enchantments that when shot at any arthropod like spider it will crash the server. 

// public void onTargetDamaged(LivingEntity user, Entity target, int level) {
    if (target instanceof LivingEntity) {
        LivingEntity livingEntity = (LivingEntity) target;
        if (this.typeIndex == 2 && livingEntity.getGroup() == EntityGroup.ARTHROPOD) {
        int amplifier = 20 + user.getRandom().nextInt(10 * level);
        livingEntity.addStatusEffect(new StatusEffectInstance(StatusEffects.SLOWNESS, amplifier, 3));
        }
    }
}

Stack trace

Description: Ticking entity

java.lang.IllegalArgumentException: bound must be positive
	at java.util.Random.nextInt(Unknown Source)
	at brl.a(SourceFile:89)
	at brq.a(SourceFile:155)
	at brq.a(SourceFile:114)
	at java.util.Optional.ifPresent(Unknown Source)
	at brq.a(SourceFile:114)
	at brq.a(SourceFile:120)
	at brq.b(SourceFile:157)
	at bho.a(SourceFile:389)
	at bia.a(SourceFile:123)
	at bho.j(SourceFile:221)
	at bhq.j(SourceFile:103)
	at aav.a(SourceFile:687)
	at btu.a(SourceFile:484)
	at aav.a(SourceFile:418)
	at ckt.a(SourceFile:54)
	at aav.a(SourceFile:393)
	at net.minecraft.server.MinecraftServer.b(SourceFile:870)
	at net.minecraft.server.MinecraftServer.a(SourceFile:810)
	at eue.a(SourceFile:93)
	at net.minecraft.server.MinecraftServer.w(SourceFile:669)
	at net.minecraft.server.MinecraftServer.a(SourceFile:257)
	at java.lang.Thread.run(Unknown Source)

Fixed

Ray

[Mojang] Matthew Gatland

2021-01-23, 01:36 AM

2021-02-17, 09:04 AM

2021-02-17, 09:04 AM

1

1

Confirmed

Very Important

Crash

21w03a

21w07a