registerListener()

Discussion in 'Plugin Development' started by DylanG, Jan 3, 2011.

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

    DylanG

    getServer().getPluginManager().registerEvent(Event.Type.PLAYER_JOIN, playerListener, Priority.

    Normal, this

    );
    getServer().getPluginManager().registerEvent(Event.Type.PLAYER_QUIT, playerListener, Priority.

    Normal, this

    );
    getServer().getPluginManager().registerEvent(Event.Type.PLAYER_COMMAND, playerListener, Priority.

    Normal, this
    );

    Event cannot be resolved to a variable


    playerListener cannot be resolved to a variable

    And, how do I make a "plugin.yml" file, what do I put in it, and where?

    Thanks,
    Dylang
     
  2. Offline

    SpeaKeasY

    If you are trying to make a plugin for bukkit, you should compile it from source. you can find that at http://github.com/Bukkit
    Also see the example plugin for help with yaml or read yaml documentation (google "java yaml")
    Be aware that there are still a lot of things yet to be implemented and some things are not fully implemented, they aren't bugs though, the project is still under construction and they should all be fixed and tested when it is officially released.
     
  3. Offline

    DylanG

    I downloaded the snapshot of bukkit.jar. I'll redownload the new snapshot if there is one.
     
  4. Offline

    tkelly

    For your question about the yml file, you just have to make a .yml file in the source directory and include:
    Code:
    name: Awesome Plugin!
    version: 1.0
    main: org.awesomeness.AwesomePlugin
    
     
  5. Offline

    Samkio

    I too have this problem which has arisen recently.
    I have got the latest build but this "Event cannot be resolved to a variable" still occurs.
    Any light on the matter? :)

    EDIT:
    getServer().getPluginManager().registerEvent(org.bukkit.event.Event.Type.PLAYER_QUIT,...

    That works must be a error in importing i guess.

    Hope this helps other people. [​IMG]
     
  6. Offline

    ShaDooM

    thx samkio that "org.bukkit.event" saved me a lot of time :)
     
  7. Offline

    Samkio

    Your welcome i think the import has changed to:
    Code:
    import org.bukkit.event.Event;
    So that should work now. :D
     
Thread Status:
Not open for further replies.

Share This Page