SHARE
TWEET

Untitled

a guest Feb 26th, 2019 141 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package de.javazeiichen.bigbyte.events;
  2.  
  3. import de.javazeiichen.bigbyte.api.CoinsAPI;
  4. import de.javazeiichen.bigbyte.api.StatsAPI;
  5. import de.javazeiichen.bigbyte.data.Utils;
  6. import org.bukkit.Bukkit;
  7. import org.bukkit.EntityEffect;
  8. import org.bukkit.Sound;
  9. import org.bukkit.entity.Player;
  10. import org.bukkit.event.EventHandler;
  11. import org.bukkit.event.Listener;
  12. import org.bukkit.event.entity.EntityDamageEvent;
  13. import org.bukkit.potion.PotionEffect;
  14. import org.bukkit.potion.PotionEffectType;
  15.  
  16. public class DeathEvent implements Listener {
  17.  
  18.  
  19.     @EventHandler
  20.     public void onPlayerDeath(org.bukkit.event.entity.PlayerDeathEvent event) {
  21.         Player player = (Player) event.getEntity();
  22.         EntityDamageEvent entityDamageEvent = player.getLastDamageCause();
  23.  
  24.  
  25.  
  26.        String prefix = "§7•§8● §6§lEvil§f§lSucht §7» ";
  27.  
  28.         player.getKiller().sendMessage("TEST!");
  29.  
  30.        event.setDeathMessage(prefix+ "§7Der Spieler §a§l" +player.getDisplayName()+ " §7wurde misshandelt!");
  31.  
  32.        player.getKiller().sendTitle("§a§l✔", "§a+ §6§l2 Coins");
  33.        player.sendTitle("§4✘", "§cDu bist gestorben!");
  34.  
  35.        StatsAPI.addKills(player.getKiller().getUniqueId().toString(), 1);
  36.        StatsAPI.addDeaths(player.getUniqueId().toString(), 1);
  37.        player.getKiller().playSound(player.getLocation(), Sound.LEVEL_UP, 10, 10);
  38.  
  39.         CoinsAPI.addCoins(player.getKiller(), 1);
  40.  
  41.        player.getKiller().addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 200, 10));
  42.        event.getDrops().clear();
  43.  
  44.     }
  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