Results 1 to 2 of 2
  1. #1
    ds4
    ds4 is offline Member
    Join Date
    Dec 2013
    Posts
    1
    Rep Power
    0

    Default "Drop Item" and "Inventory Search" Methods Aren't Working

    I am working on a game in BlueJ and I am trying to add a "drop" and "items" command in order to drop an item and see a list of the player's current inventory. However, when I use either command in the game it results in a "nullpointerexception" error message. The "take" method is very similar to the "drop" method but it works so I am unsure what is happening. I have attached screenshots which show the methods being used in the Game class and the error in the Player class.
    Attached Thumbnails Attached Thumbnails "Drop Item" and "Inventory Search" Methods Aren't Working-screen-shot-2013-12-04-12.57.02-pm.png   "Drop Item" and "Inventory Search" Methods Aren't Working-screen-shot-2013-12-04-12.56.20-pm.png   "Drop Item" and "Inventory Search" Methods Aren't Working-screen-shot-2013-12-04-12.55.48-pm.png  

  2. #2
    jpil is offline Member
    Join Date
    Dec 2013
    Posts
    2
    Rep Power
    0

    Default Re: "Drop Item" and "Inventory Search" Methods Aren't Working

    It may be a problem to do with the removeItem() method. Could you post the full error log please?

Similar Threads

  1. Replies: 0
    Last Post: 12-07-2012, 09:29 AM
  2. Replies: 3
    Last Post: 10-30-2012, 04:06 PM
  3. Replies: 1
    Last Post: 02-01-2012, 09:37 PM
  4. Replies: 2
    Last Post: 01-24-2009, 07:56 PM
  5. Replies: 1
    Last Post: 10-20-2008, 08:35 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •