When I click  on World (w) the code (w.addObject(new Boomerang(), 100, 300);) makes it crash. I am sure that that line is the problem because the code didn't crash when I commented it out.
context: code is in Actor subclass called Items and Boomerang is a subclass from items.
  public void act()
    {
        if(boomCheck == 0)
        {
            throwBoomerang();
        }
        
    }
    
    public void throwBoomerang()
     {
       //Zorgt ervoor dat je een boomerang kan gooien.
       
       if(Greenfoot.mousePressed(w))
        {
           
            Minion2X = minion.MinionX;
            Minion2Y = minion.MinionY;
        
            
            w.addObject(new Boomerang(), 100, 300);
            boomCheck = 1;
        }
     } 
          
         
   



