Guest User

Untitled

a guest
Jul 23rd, 2013
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.68 KB | None | 0 0
  1. @EventHandler
  2.     public void onDamage(PotionSplashEvent evt) {
  3.         Material mat = evt.getPotion().getItem().getData().getItemType();
  4.         byte id1     = evt.getPotion().getItem().getData().getData();
  5.         byte id2     = evt.getPotion().getItem().getData().getData();
  6.  
  7.         if (mat == Material.POTION) {
  8.             if (id1 == 32732 || id2 == 32764) {
  9.                 for (LivingEntity le : evt.getAffectedEntities()) {
  10.                     if (le instanceof Player) {
  11.                         Player p = (Player) le;
  12.                         double schaden = evt.getIntensity(p) / 2;
  13.                         evt.setIntensity(p, schaden);
  14.                     }
  15.                  }
  16.             }
  17.         }
  18.     }
Advertisement
Add Comment
Please, Sign In to add comment