Solved protocollib ProtocolManager is null error

Discussion in 'Spigot Plugin Development' started by weedsnorkeler, Jul 9, 2021.

  1. I'm trying to use ProtocolLib but I get an error saying ProtocolManager is null. I thought it was a problem with my plugin so I created a blank one but I still get the same error. Am I right to be putting the same ProtocolLib jar I put in my server plugins into my plugins dependencies or is there some other file I need to download? I have the plugin in the servers plugins folder and I have ProtocolLib in my plugins dependencies I'm not sure what could be causing this.
  2. Are you using maven?
  3. no do i need to be? i tried to use it earlier but it just broke everything and confused me
  4. Can you show your code?
  5. this is just to test if ProtocolLib is working and i get an error saying pm is null, i just copied it from some youtube tutorial
    Code (Java):
    Player player = (Player) sender;
    Location loc = player.getTargetBlock(null,48).getLocation();

    ProtocolManager pm = ProtocolLibrary.getProtocolManager();
    PacketContainer packet = pm.createPacket(PacketType.Play.Server.EXPLOSION);


    try {
    } catch (InvocationTargetException e) {
  6. i tried setting up a test plugin with maven solely to get ProtocolLib working and i still get the same error about pm being null

    this is my pom.xml
    Code (XML):
    <?xml version="1.0" encoding="UTF-8"?>
    <project xmlns=""





    still have depend: [ProtocolLib] in my plugin.yml, am i doing something wrong?
  7. bump ive been trying to debug this for like a day could it be my computer?? ive tried like 4 different versions and have made like 2 separate servers and test plugins i am so lost
  8. You forgot add scope>provided</scope> for ProtocolLib
    • Like Like x 1
  9. thank you so much that was exactly what it was