AnonymousHacker1279 / ImmersiveWeapons

Immersive Weapons is more than just a weapons mod aiming to spice up your combat skills.
https://anonymoushacker1279.tech/wiki/immersiveweapons
MIT License
4 stars 5 forks source link

1.18.2 Forge - Hans Crash #83

Closed EldrinFal closed 1 year ago

EldrinFal commented 1 year ago

Hello,

Recently, Hans spawned in my game and crashed it when we fought. I restarted the game, he was there still, and it crashed again when we fought. I'm attaching my crash logs from both crashes.

crash-2023-02-05_19.52.05-server.txt crash-2023-02-05_19.48.04-server.txt

AnonymousHacker1279 commented 1 year ago

I cannot seem to reproduce this issue. Strangely, this exception is being thrown on Line 84 of the HansEntity class, which simply defers the execution back to the parent class (i.e. vanilla MC is handling this entity tick, not me):

@Override
public void aiStep() {
    super.aiStep(); // crashing here
    if (!level.isClientSide) {
        AABB scanningBox = new AABB(blockPosition().offset(-50, -50, -50),
                blockPosition().offset(50, 50, 50));

        for (Player player : level.getNearbyPlayers(TargetingConditions.forNonCombat(), this, scanningBox)) {
            checkForDiscovery(this, player);
        }
    }
}

Relevant Code

Since it is a ConcurrentModificationException, that means something in another thread is modifying a list in the vanilla entity code where it shouldn't be.

There are a lot of mods in there, perhaps one of them is causing a conflict? If you can, try playing with Immersive Weapons by itself and add your mods back in slowly until it starts to crash again - then that'll point to a potential mod conflict.

EldrinFal commented 1 year ago

I haven't really had time to go through and do a binary test. Strangely though, my son was playing on creative using mostly the same mods, and he didn't crash when fighting Hans. So perhaps it's either a multiplayer/server thing, or possibly one of the few mods I took out was the culprit. Maybe I'll try creative on my system and see if it crashes.

AnonymousHacker1279 commented 1 year ago

Let me know if you encounter it again. ConcurrentModificationExceptions can be random to encounter, because they are often caused by race conditions in threads. I'll keep this issue open for a while in case it can be reproduced.

AnonymousHacker1279 commented 1 year ago

Closing due to inactivity.