Multiple classes

Discussion in 'Plugin Development' started by Roelyboely12, Mar 15, 2015.

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

    Roelyboely12

    I think this has been asked over and over
    i did a tutorial but it didn't work
    can someone give me a working example?
     
  2. Offline

    Ruptur

  3. Offline

    Roelyboely12

    Yes i know google
     
  4. Offline

    Ruptur

    @Roelyboely12

    Main class
    Code:java
    1.  
    2. package me.ruptur.facepalm;
    3. import org.bukkit.plugin.java.JavaPlugin;
    4.  
    5. public class Facepalm extends JavaPlugin {
    6. // Do stuff
    7. public void onEnable(){
    8. this.getServer().getPluginManager().registerEvents(new facepalmextraextra(), this);
    9. }
    10. }
    11.  


    Another class
    Code:java
    1.  
    2. public class facepalmextraextra implements Listener{
    3. // doesnt have to implemnt listenr, just an example
    4.  
    5. @Eventhandler
    6. public void onPlayerSlapFace(PlayerSlapFaceEvent event){
    7. killcode.exeucte;
    8. google.hack;
    9. // Do stuff ...
    10. }
    11. }
    12.  
     
  5. Offline

    Roelyboely12

    @Ruptur
    Thank you

    Is there an alternative for jd.bukkit.org since it is offline?

    EDIT: already got it
     
  6. Offline

    Ruptur

    Last edited by a moderator: Mar 15, 2015
  7. Offline

    RainoBoy97

Thread Status:
Not open for further replies.

Share This Page