Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.33 KB | None | 0 0
  1. public void onKill(PlayerDeathEvent event){
  2. Player killed = event.getEntity();
  3.  
  4. if(ConfigurationService.KITMAP_STATUS && killed instanceof Player){
  5. Player killer = event.getEntity().getKiller();
  6. killer.sendMessage("check returned true");
  7. int killstreak = plugin.getPlayerManager().getPlayerData(killer).getKillstreak();
  8. plugin.getPlayerManager().getPlayerData(killer).setKillstreak(killstreak + 1);
  9. if(killstreak > 1){
  10. plugin.getPlayerManager().getPlayerData(killed).setKillstreak(0);
  11. killed.sendMessage(Color.translate("&c&lYOUR KILLSTREAK WAS ENDED BY &e" + killer.getDisplayName()));
  12. return;
  13. }
  14. int potionTime = 20*(8*60);
  15. switch (plugin.getPlayerManager().getPlayerData(killer).getKillstreak()){
  16. case 3: killer.sendMessage(ChatColor.GREEN + ChatColor.BOLD.toString() + "3 PLAYER KILLSTREAK! " +
  17. ChatColor.GOLD + ChatColor.BOLD.toString() + "AWARDED 5 GOLDEN APPLES");
  18. ItemStack goldenApples = new ItemStack(Material.GOLDEN_APPLE, 5);
  19. putItemInInventory(killer, goldenApples);
  20.  
  21. break;
  22. case 6:
  23. killer.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE, potionTime, 0));
  24. killer.sendMessage(ChatColor.GREEN + ChatColor.BOLD.toString() + "6 PLAYER KILLSTREAK! " +
  25. ChatColor.GOLD + ChatColor.BOLD.toString() + "AWARDED 8 MINUTES OF FIRE RESISTANCE");
  26. break;
  27. case 9:
  28. ItemStack slownessPotion = new ItemStack(Material.POTION, 1, (short) 16426);
  29. ItemStack poisonPotion = new ItemStack(Material.POTION, 1, (short) 16388);
  30.  
  31. putItemInInventory(killer, slownessPotion);
  32. putItemInInventory(killer, poisonPotion);
  33. killer.sendMessage(ChatColor.GREEN + ChatColor.BOLD.toString() + "9 PLAYER KILLSTREAK! " +
  34. ChatColor.GOLD + ChatColor.BOLD.toString() + "AWARDED DEBUFFS");
  35. break;
  36. case 12:
  37. killer.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, potionTime, 1));
  38. killer.sendMessage(ChatColor.GREEN + ChatColor.BOLD.toString() + "12 PLAYER KILLSTREAK! " +
  39. ChatColor.GOLD + ChatColor.BOLD.toString() + "AWARDED 8 MINUTES OF SPEED II");
  40. break;
  41.  
  42. case 17:
  43. killer.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, potionTime, 0));
  44. killer.sendMessage(ChatColor.GREEN + ChatColor.BOLD.toString() + "17 PLAYER KILLSTREAK! " +
  45. ChatColor.GOLD + ChatColor.BOLD.toString() + "AWARDED 8 MINUTES STRENGTH I");
  46. break;
  47. case 24:
  48. ItemStack godApple = new ItemStack(Material.GOLDEN_APPLE, 1, (short) 1);
  49. putItemInInventory(killer, godApple);
  50. killer.sendMessage(ChatColor.GREEN + ChatColor.BOLD.toString() + "24 PLAYER KILLSTREAK! " +
  51. ChatColor.GOLD + ChatColor.BOLD.toString() + "AWARDED A GOD APPLE");
  52. case 27:
  53. killer.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, potionTime, 0));
  54. killer.sendMessage(ChatColor.GREEN + ChatColor.BOLD.toString() + "27 PLAYER KILLSTREAK! " +
  55. ChatColor.GOLD + ChatColor.BOLD.toString() + "AWARDED 8 MINUTES INVISIBILITY");
  56. break;
  57. case 30:
  58. potionTime = 20*(60*60);
  59. killer.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, potionTime, 0));
  60. killer.sendMessage(ChatColor.GREEN + ChatColor.BOLD.toString() + "30 PLAYER KILLSTREAK! " +
  61. ChatColor.GOLD + ChatColor.BOLD.toString() + "AWARDED PERMANENT SPEED II");
  62. break;
  63. default:
  64. killer.sendMessage("error");
  65. }
  66.  
  67. }
  68. Player killer = event.getEntity().getKiller();
  69. killer.sendMessage("check returned true");
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement