Advertisement
ExtremeLyrics

Untitled

Jun 16th, 2014
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.56 KB | None | 0 0
  1.     @EventHandler
  2.     public void onPlayerDamage(EntityDamageByEntityEvent e) {
  3.  
  4.         if (Protection.hasProtection(e.getEntity().getLocation()))
  5.             //This runs
  6.             e.setCancelled(true);
  7.  
  8.         if (Protection.hasProtection(e.getDamager().getLocation()))
  9.             //This runs
  10.             e.setCancelled(true);
  11.        
  12.         if(e.getDamager() instanceof Player)
  13.             if(ProtectionCooldown.isOnProtCooldown((Player) e.getDamager()))
  14.                 e.setCancelled(true);
  15.        
  16.         if(e.getEntity() instanceof Player)
  17.             if(ProtectionCooldown.isOnProtCooldown((Player) e.getEntity()))
  18.                 e.setCancelled(true);
  19.  
  20.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement