Mob Crashes Game When Hits Player

Status
Works as designed
Type
Product/platform
Not applicable
Priority
Normal
Issue description

In my mod there is a boss called "Sobek." Whenever I test it out and the Sobek hits the player, the game crashes. I can't figure out why as I've made plenty of other mobs that can hit players without any problems with the game. The mod zip is attached.

Attachment Size
Glory Of The Journey zip file1.1 MB 1.1 MB

Issue comments

The CactusArmorCauseIrritationProcedure which is triggered on entity attacked global trigger checks armor slot 4 which does not exist. Only slots 0 - 3 exist.

The crash log also told you this:

Caused by: java.lang.ArrayIndexOutOfBoundsException: 4
at java.util.Arrays$ArrayList.get(Arrays.java:3841) ~[?:1.8.0_265] {}
at net.minecraft.util.NonNullList.get(NonNullList.java:45) ~[forge-1.15.2-31.2.0_mapped_snapshot_20200514-1.15.1-recomp.jar:?] {re:classloading}
at net.mcreator.gloryofthejourney.procedures.CactusArmorCauseIrritationProcedureProcedure.executeProcedure(CactusArmorCauseIrritationProcedureProcedure.java:47) ~[main/:?] {re:classloading}
at net.mcreator.gloryofthejourney.procedures.CactusArmorCauseIrritationProcedureProcedure.onEntityAttacked(CactusArmorCauseIrritationProcedureProcedure.java:73) ~[main/:?] {re:classloading}



Donate to MCreator

By donating to developers you can speed up development, as with more resources, we can dedicate more time to MCreator. It is a free project made by developers working on it in their free time.