code is for a shoot method, which shoots on left click, error terminal keeps coming up at random times. can anyone help?
public void shoot ()
{
if( shotTimer >0)
{
shotTimer = shotTimer -1;}
else if( Greenfoot.getMouseInfo().getButton() == 1)
{
getWorld().addObject(new bullet(playerRotation), getX(), getY());
shotTimer = 15;
Greenfoot.playSound("bolt.wav");
}
}

