Solved Register event mistake?

Discussion in 'Plugin Development' started by TomTheDeveloper, Mar 19, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    TomTheDeveloper

    Main class, onEnable method

    Code:java
    1. public void onEnable(){
    2. new listeners(this);
    3. config = ConfigurationManager.getConfig("config");


    Listeners class for my listeners
    Code:java
    1. public class listeners extends villagedefender implements Listener {
    2.  
    3.  
    4. ArrayList<String> Lobbylist = new ArrayList<String>();
    5.  
    6. public listeners(villagedefender plugin) {
    7. plugin.getServer().getPluginManager().registerEvents(this, plugin);
    8. }



    Event;
    Code:java
    1. public void SignJoin(PlayerInteractEvent e){
    2. e.getPlayer().sendMessage("debug");


    If i start a test server with this, and i click on a block, i don't get the message "debug", i think this is a stupid mistake of me, but i can't find it, i tried many things. How do I solve this?
     
  2. Offline

    nisovin

    You need to use the @EventHandler annotation.
     
  3. Offline

    TomTheDeveloper

    Oh, i got it, i replaced my external jar, and that is why i couldn't import @eventhandler, it was a really weird mistake.

    But it is al correct, I tried to import @EventHandler, but i gave me an error because the external java was not there anymore

    Sorry
     
Thread Status:
Not open for further replies.

Share This Page