Advertisement
Guest User

NoDeathMessage by Vaquxine

a guest
Mar 16th, 2012
1,147
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.98 KB | None
  1. package me.vaqxine.NoDeathMessage;
  2.  
  3. import org.bukkit.event.EventHandler;
  4. import org.bukkit.event.EventPriority;
  5. import org.bukkit.event.Listener;
  6. import org.bukkit.event.entity.EntityDeathEvent;
  7. import org.bukkit.event.entity.PlayerDeathEvent;
  8. import org.bukkit.plugin.PluginManager;
  9. import org.bukkit.plugin.java.JavaPlugin;
  10.  
  11. public class NoDeathMessage extends JavaPlugin implements Listener {
  12.  
  13.    
  14.     @Override
  15.     public void onDisable() {
  16.            System.out.println("NoDeathMessage (v1.1) has been disabled.");
  17.     }
  18.  
  19.     @Override
  20.     public void onEnable() {
  21.          PluginManager pm = getServer().getPluginManager();
  22.          pm.registerEvents(this, this);
  23.          System.out.println("NoDeathMessage (v1.1) has been enabled.");
  24.     }
  25.  
  26.     @EventHandler(priority = EventPriority.NORMAL)
  27.     public void onEntityDeath(EntityDeathEvent event) {
  28.           if (event instanceof PlayerDeathEvent) {
  29.                 PlayerDeathEvent e = (PlayerDeathEvent) event;
  30.                 e.setDeathMessage(null);
  31.             }
  32.   }
  33. }
Advertisement
RAW Paste Data Copied
Advertisement