Advertisement
Guest User

code

a guest
Mar 6th, 2016
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. @EventHandler
  2.  
  3. public void onHoldShield(PlayerItemHeldEvent e){
  4.  
  5.  
  6. Player hero = e.getPlayer();
  7. ItemStack item = hero.getItemInHand();
  8. Material item2 = item.getType();
  9.  
  10.  
  11.  
  12. if(item2 == Material.IRON_TRAPDOOR){
  13.  
  14. PotionEffect effect = PotionEffectType.REGENERATION.createEffect(999999999, 1);
  15. hero.addPotionEffect(effect,true);
  16.  
  17. }
  18. else{
  19. hero.removePotionEffect(PotionEffectType.REGENERATION);
  20. }
  21.  
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement