Fix ArrayOutOfBoundsException with spawn priority