Mob Crashes Game When Hits Player

Works as designed
Not applicable
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( ~[?:1.8.0_265] {}
at net.minecraft.util.NonNullList.get( ~[forge-1.15.2-31.2.0_mapped_snapshot_20200514-1.15.1-recomp.jar:?] {re:classloading}
at net.mcreator.gloryofthejourney.procedures.CactusArmorCauseIrritationProcedureProcedure.executeProcedure( ~[main/:?] {re:classloading}
at net.mcreator.gloryofthejourney.procedures.CactusArmorCauseIrritationProcedureProcedure.onEntityAttacked( ~[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.