daily pastebin goal
17%
SHARE
TWEET

Untitled

a guest Aug 10th, 2018 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //first class    
  2. package com.courbie.helloworld;
  3.  
  4. import org.bukkit.event.EventHandler;
  5. import org.bukkit.plugin.PluginManager;
  6. import org.bukkit.plugin.java.JavaPlugin;
  7.  
  8. public class Main extends JavaPlugin{
  9.  
  10.     @EventHandler
  11.     public void onEnable() {
  12.  
  13.         getLogger().info("Hey Courbie, have a good day!");
  14.         PluginManager pm = getServer().getPluginManager();
  15.         MyFirstListener listener = new MyFirstListener();
  16.         pm.registerEvents(listener, this);
  17.     }
  18.  
  19.     @Override
  20.     public void onDisable() {
  21.         getLogger().info("MyPlugin has been disabled.");
  22.     }
  23.  
  24. }
  25.  
  26. //Second class
  27. package com.courbie.helloworld;
  28.  
  29. import org.bukkit.event.EventHandler;
  30. import org.bukkit.event.Listener;
  31. import org.bukkit.event.player.PlayerJoinEvent;
  32.  
  33. public class MyFirstListener implements Listener{
  34.  
  35.     //Constructor
  36.     public void FirstListener (final Main Plugin) {
  37.  
  38.     }
  39.  
  40.     //EventHandler
  41.     @EventHandler
  42.     public void onPlayerJoin(PlayerJoinEvent event) {
  43.  
  44.         event.getPlayer().sendMessage("Hello! How are you today Courbie?");
  45.  
  46.     }
  47.  
  48. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top