The great thing about this is when the conditions are met, an exception is thrown that will provide insight into the cause of the problem.Code:public static void crossbowSpecial(Client c, int i) {
Player[] players = PlayerHandler.players;
if (i < 0 || i > players.length - 1) {
throw new IllegalStateException("Cannot perform special on index outside of player capacity.");
}
Client p = (Client) players[i];
// other code
}
