Faulty aggressive mobs AI
progfz opened this issue ยท 1 comments
General Info
- [ x] I am running a modpack
- [ x] I can reproduce this issue consistently
- [ x] In single player
- [ x] In multiplayer
- [ x] I have searched for this issue previously and it was either (1) not previously reported, or (2) previously fixed and I'm having the same problem.
- I am crashing and can provide my crash report(s)
- [ x] I am using the latest version of the mod
Client Info
-
Minecraft Version: 1.12.2
-
Forge Version: 14.23.5.2768
-
Mod Version: 1.6.4
-
Java Version: 8
Issue Description
Naturally spawned aggressive mobs behave passively toward player. Mobs loaded with map or spawned from eggs behave properly.
Reproduce Steps
- Start new server with mod installed, fresh map, no restarts.
- Wait for hostile mobs to spawn or actively find one using creative mode (no spawning from eggs, only naturally spawned ones)
- Confirm that mob is not hostile while it should be
- Save, stop and restart server so mob is reloaded from disk alongside with map
- Confirm that now mob is properly aggressive
Additional Information
This probably happens due to missing call to setHostile on mob spawn as readEntityFromNBT is probably not called for naturally spawned mobs, only for eggs and ones loaded with map. This could probably be fixed by adding another call to setHostile in entityInit after NEUTRAL flag is set.