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. src/main/java/com/github/patrick/bridge/ BridgePlugin.java BridgeConfig.java ConfigReloader.java process/ BridgeListener.java BridgePlayer.java BridgeProcess.java BridgeScheduler.java BridgeTeam.java Error Log on my Server
BridgePlayer.java:25 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.
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.