Improved Mobs (Fabric)

Improved Mobs (Fabric)

170k Downloads

Crash on particular item use

noncom opened this issue ยท 2 comments

commented

Modloader

Forge

Minecraft version

1.19.2

Modloader version

43.2.4

Mod version

1.11.0

TenshiLib version

1.6.14

Description

Having a crash each time a mob wields the Shield of Solar God from Solar Craft.

By looking at the items code there's a clear reason why it crashes that Solar Craft could fix, and I've created an issue for that already: FINDERFEED/SolarCraftRepository#33
And I've disabled this item in the Improved Mobs config, so it's ok for now.

But this brings up the question:
Could Improved Mods have their own mechanism of protection against such crashes?
I think that crashing on item use is something that can potentially happen quite easily with mobs using items from various mods.

So what I think could be done with this issue:

  • Catch any exceptions that happen on item use and don't let them crash the game
  • Write them to the log with a message kinda something like "Exception on using item XXX, you should probably report this to the items mod author"
  • Maybe make it toggleable from the config so that if one wants to catch crashes, they can (for debug purposes or whatever)
  • Unless this should be addressed to Forge ๐Ÿค”

Steps to reproduce

  1. Have Improved Mobs and Solar Craft (reproduces with v3.0.2) installed
  2. Make a mob equip the Shield of Solar God
  3. Crash

Mods that might affect the issue

Solar Craft

Logs

https://gist.github.com/noncom/cc9485ba95ff957de033355528177a38

commented
Could Improved Mods have their own mechanism of protection against such crashes?
I think that crashing on item use is something that can potentially happen quite easily with mobs using items from various mods.

if other mods are properly coded this shouldn't be an issue in the first place so no. sorry.
e.g. in this case blind casting should never be done.
also by the game crashing people can actually report it instead of broken code staying broken

commented

Okay, right, that makes sense!