Solved Listener is not working

Discussion in 'Spigot Plugin Help' started by FrNomad, Jul 12, 2021.

  1. In my plugin, listener class is sub class of main class
    (It must be...)

    And I wrote this code to register listener (EventH is the name of listener class)
    Code (Text):
    getServer().getPluginManager().registerEvents(new EventH(), this);
    And then... listener is not working at all!

    How can I solve this?
     
  2. Saying "is not working" doesn't help anyone figure out what is wrong. Please post the code of the EventH class.
     
  3. Try to make sure that the class has "implements Listener or @EventHandler"
     
  4. getServer().getPluginManager().registerEvents(new EventH(), this);

    Where did you put this code?
    Also show the whole EventH() event.
     
  5. Ah, It solved!
    Thanks for reply everyone!