Registering events(SuperEasyQuestion)

Discussion in 'Plugin Development' started by ShredNyx, Dec 16, 2013.

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

    ShredNyx

    I have 2 classes test1 and test2 how do I register events from test2 if test1 is my main in my plugin.yml. I have this in test 1 extends JavaPlugin implements Listener.
     
  2. Offline

    Gater12

  3. Offline

    Ronbo

    Make sure test2 is implementling Listener as well if that's where your even listeners are.

    Then just use this
    Code:text
    1. getServer().getPluginManager().registerEvents(new test2(), this);


    in your test1 onEnable()
     
  4. Offline

    ShredNyx

    pope_on_dope

    The constructor test2() is undefined Ronbo

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 5, 2016
  5. Offline

    Ronbo

    ShredNyx
    Try test2(this)

    If that doesn't work either, please post your whole test2 class.
     
  6. Offline

    ShredNyx

Thread Status:
Not open for further replies.

Share This Page