Solved Need help with Protocol Lib Packet Listener

Discussion in 'Plugin Development' started by TheBrightnessMan, Aug 11, 2020.

Thread Status:
Not open for further replies.
  1. I planned to make an NPC plugin with packets using Protocol Lib, but I keep getting a Null Pointer Exception when I tried to listen on packets.

    This is my main class (I removed some of the code irrelevant to my issue)
    public class Main extends JavaPlugin {
        public void onEnable() {
    private void packetListener() {
            ProtocolManager manager = ProtocolLibrary.getProtocolManager();
                    new PacketAdapter(this, PacketType.Play.Client.USE_ENTITY) {
                        public void onPacketReceiving(PacketEvent event) {
    The Null Pointer Exception message in the console says the error occurred in line 133, which is

    Thanks in advance
  2. Online

    timtower Moderator Moderator

  3. oh I totally forgot about that

    thread marked as SOLVED
Thread Status:
Not open for further replies.

Share This Page