Solved Null pointer exception?

Discussion in 'Spigot Plugin Development' started by Tincon1, Dec 19, 2018.

  1. md_5

    Administrator Developer

    ItemStack itemhelmet = event.getCurrentItem();
    ItemMeta metahelmet = itemhelmet.getItemMeta();

    itemhelmet is null
     
    • Like Like x 1
  2. To add onto that you must not be doing that in your classes Resist and Health as well since they are also throwing the error. Add a null check on the item
     
    • Like Like x 1
  3. hahaha, oops. Thanks a lot, maybe I should stick to coding while sober