Guest User

Untitled

a guest
Dec 26th, 2015
50
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package me.kitpvp.listeners;
  2.  
  3. import org.bukkit.Bukkit;
  4. import org.bukkit.ChatColor;
  5. import org.bukkit.entity.Player;
  6. import org.bukkit.event.EventHandler;
  7. import org.bukkit.event.Listener;
  8. import org.bukkit.event.entity.PlayerDeathEvent;
  9. import org.bukkit.event.player.PlayerJoinEvent;
  10. import org.bukkit.event.player.PlayerQuitEvent;
  11. import org.bukkit.event.player.PlayerRespawnEvent;
  12.  
  13. import me.kitpvp.main.Main;
  14.  
  15. public class PlayerListeners implements Listener{
  16.  
  17.     Main plugin;
  18.     public PlayerListeners(Main instance) {
  19.         this.plugin = instance;
  20.     }
  21.     //when player joins the server
  22.     @EventHandler
  23.     public void PlayerJoin(PlayerJoinEvent e) {
  24.         Player p = e.getPlayer();
  25.         String pname = p.getName();
  26.         p.getInventory().clear();
  27.         //Message to send to the server on join!
  28.         Bukkit.broadcastMessage(ChatColor.GRAY + pname + "has joined the nigger server!");
  29.     }  
  30.     //when player leaves the server
  31.     @EventHandler
  32.     public void PlayerLeave(PlayerQuitEvent e) {
  33.         Player p = e.getPlayer();
  34.         String pname = p.getName();
  35.         p.getInventory().clear();
  36.         //Message to send to the server on join!
  37.         Bukkit.broadcastMessage(ChatColor.GRAY + pname + "has left the nigger server!");
  38.     }
  39.     //end of player leaving the server
  40.     @EventHandler
  41.     public void death(PlayerDeathEvent e){
  42.        
  43.         Player p = e.getEntity();
  44.         Player k = p.getKiller();
  45.         e.getDrops().clear();
  46.         e.setDeathMessage("" + ChatColor.GRAY + e.getEntity() + " was killed by " + p.getKiller());
  47.     }
  48. }
RAW Paste Data