Pixelmon Mod - Bug tracker

[Pixelmon 9.1.3] Crash during battles not a bug

Ticket description:
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/9vWbOZ6KdK

From 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/jSHApBXYxk

The 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.

Comments

#29490 Posted by Decent60 » 28 Mar 2023 23:17

Greetings,

This one is actually a common issue with having your Java higher than 8 or 11.
Pixelmon and Minecraft 1.16.5 were written in Java 8 and perform best there. Java 11 does work as well (and some mods for 1.16.5 are written for it).

Ticket details

  • Ticket ID: 20261
  • Project: Pixelmon Mod
  • Status: Not a bug
  • Component: Crash
  • Project version: 1.16.5-9.x.x
  • Priority: Normal
  • Severity: Normal
  • Forge/Sponge: Forge 36.2.39
  • What else would be useful to know?: GraalVM EE 22.3.1 (JDK 17.0.6) - Mod and argument lists available in the report
  • Assigned to: Decent60
  • Reported by: Despota (Send PM)
  • Reporter's tickets: (List all tickets)
  • Reported on: 24 Mar 2023 23:13
  • Ticket last visited by: Decent60 on 28 Mar 2023 23:17
JOIN THE TEAM