A friend is having recurring problems using Pixelmon on a small server hosted by another friend. There are other tickets about this same problem, but I'll try to provide better detail in this one.
https://bytebin.lucko.me/9vWbOZ6KdKFrom the stack trace, it appears that the crash occurred while rendering the Choose Attack screen within the Battle Screen GUI.
The setTargeting() method within BattleScreen is being called with an index of 0, which is outside the expected range of values. This suggests a possible issue with the data being passed to the setTargeting() method or with the initialization of the data beforehand.
This having been noted, I suggested enabling a setting for debugging:
https://bytebin.lucko.me/jSHApBXYxkThe Index 0 out of bounds for length 0 part of the error message indicates that an attempt was made to access an array element at index 0, but the array has length 0, suggesting that there is an empty array being accessed somewhere in the code, which is causing the crash.
It is possible that there is a bug in the way that the targeting system is being handled, which is causing an empty array to be passed to the setTargeting() method. There could also be an issue with how the ChooseAttack class is interacting with the BattleScreen class, which is causing the empty array to be generated.
Since this problem usually occurs when a battle is started or when a battle is finished too quickly, it's possible that the issue is related to the timing of the battle events.