Solved Help me with NPE Error

Discussion in 'Spigot Plugin Help' started by PatrickKR, Feb 7, 2020.

  1. I created a mini game plugin using spigot 1.12 api, but it causes npe error
    Can anyone find where the error is?
    Please give me any advice. Thank you so much.

    I uploaded compiled one, sources, and javadoc.
    And if you prefer web version, i also uploaded on pastebin below.


    Error Log on my Server


    Attached Files:

    You're trying to get inventory of player before initalization of player itself. Just move inv initalization to constructor. Also you should check if player equals null.
  3. Basically:
    NPE basically means:
    - You are trying to use a value that is null but isn't supposed to be null.
    - You are trying to use a value that isn't initialized yet/correctly.
    - You are attempting to use something like an instance to perform an action when instance is initialized with the main class but not given any value.
  4. Thanks, Solved