turt2live

Untitled

Dec 18th, 2012
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.43 KB | None | 0 0
  1. public class MyPlugin extends JavaPlugin{
  2.    
  3.     public void onEnable(){
  4.         getServer().getPluginManager().registerEvents(new MyListener(this));
  5.     }
  6.    
  7. }
  8.  
  9. public class MyListener implements Listener{
  10.    
  11.     private MyPlugin plugin;
  12.    
  13.     public MyListener(MyPlugin plugin){
  14.         this.plugin = plugin;
  15.     }
  16.    
  17.     @EventHandler
  18.     public void onJoin(PlayerJoinEvent event){
  19.         plugin.getLogger().info(event.getPlayer().getName()+" joined");
  20.     }
  21.    
  22. }
Advertisement
Add Comment
Please, Sign In to add comment