Solved error code

Discussion in 'Plugin Help/Development/Requests' started by cfritten, Mar 25, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    cfritten

  2. Offline

    guitargun


    did you check if the item in your hand is not null, has itemmeta? in you code thats a no. because you want to get the item meta of an item that doesn't have one it gives the null pointer on line 20
     
  3. Offline

    cfritten

    so you are saying that i should do something like this on line 20?

    if(hand!=null && hand.getItemMeta().getDisplayName().equalsIgnoreCase("AreaSelecter")){

    sorry i'm new and don't get it. because this will also give the error
     
  4. Offline

    teej107

    @cfritten getDisplayName() may also return null
     
  5. Offline

    cfritten

    so you say that i need to check if the getDisplayName() give null?

    like:
    if(hand!=null && hand.getItemMeta().getDisplayName()!=null &&hand.getItemMeta().getDisplayName().equalsIgnoreCase("AreaSelecter")){


    thats will still give the issue/error. my plugin work for they things i want it to do but then you play normal and hit some block it give the error. i know is it in my code but there in my code the issue is i can't see
     
  6. Offline

    bwfcwalshy Retired Staff

  7. Offline

    cfritten

    thanks alot guys xD it works now!
     
Thread Status:
Not open for further replies.

Share This Page