Do I need several types of Listener classes?

Discussion in 'Plugin Development' started by TheLazeboy, May 3, 2013.

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

    TheLazeboy

    I know there are different types of Listener classes (don't know all of them, but some), but I am confused about Listener classes and such. I'm already a noob when it comes to Java and Bukkit plugin coding. My plugin, which I am very lazy about, is going to be complex (atleast to me, involving classes and world manipulation) and I need some pro tips about classes I would need. Thanks for reading! :D
     
  2. Well you can use one class per listener you need (per event), but you also can register multiple events in 1 listener, just make sure when you do that , that you don't use twice the same event in 1 class.
     
  3. Offline

    TheLazeboy

    So Listener classes are for events, and Listeners can be entirely customized based on use in-game? So my plugin, Superpowers, can have a listener class for every superpower ability (ie teleportation, nearby water/mob freezing, and healing/fatal touching)? How would classes come into this? Remember I have basically 0.1% knowledge of Java coding with Bukkit.
     
  4. I tried to decipher what you just said but yes Listeners are for events like the PlayerLoginEvent or the PlayerDeathEvent, you can put as many events in one listener as you want but remeber to never put the same event twice in a listener. If you already have the PlayerDeathEvent then only use it once in the listener..
     
  5. Offline

    TheLazeboy

    Yeah, I tried to explain that my best. :/ Okay, I believe I understand Listeners a bit more now. Thanks. :)
     
  6. No problem! If you need any help you can pm me!
     
Thread Status:
Not open for further replies.

Share This Page