Minecraft crashes sometimes when using the jetpack (ClassCastException)
See original GitHub issueIssue description:
Minecraft crashes when using the Mekanism Jetpack, seemingly at random, but always while actively using the jetpack in normal mode. This exact Exception has occurred maybe a dozen times now, I can’t reproduce it reliably and sometimes I can use the jetpack for more than a few minutes without any problems:
java.lang.ClassCastException: net.minecraft.item.AirItem cannot be cast to mekanism.common.item.gear.ItemMekaSuitArmor
I am using Mekanism as part of the TNP Limitless 3 modpack, so this could very well be caused by another mod. I have not, however, modified the configs or added any other mod to the pack like Optifine or one of the other usual suspects. At least one other person seems to have had an issue with the jetpack causing crashes in the same modpack, but they have not provided a log of that particular crash unfortunately, so I can’t be sure that this is the same issue.
Steps to reproduce:
- Equip hydrogen-powered jetpack
- Fly around randomly for a few minutes and hope for a crash 🤷
Version (make sure you are on the latest version before reporting):
Forge: 35.1.13 Mekanism: 1.16.4-10.0.18.445 Modpack: TNP Limitless 3 - 1.8.2
Crash log
Link to crash log
Link to crash log (without any added mods)
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (1 by maintainers)
Yeah, after looking at the code in question I can’t see how this should ever happen without some kind of outside interference. I’ll see if I can find out what’s causing this in the meantime, thanks a lot though.
Honestly I think another mod is probably at play here as it shouldn’t be able to get to that part of the code if the stack is empty (hence air), but it may be worthwhile when I get a chance to work on 10.0.19 to just add an extra safety check or two to prevent this.