Advertisement
Guest User

Untitled

a guest
May 26th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.62 KB | None | 0 0
  1.        @EventHandler
  2.         public void onEntityGetHit(EntityDamageEvent e){
  3.             if(e.getEntity() instanceof Player){
  4.                
  5.                 Player p = (Player)e.getEntity();
  6.                
  7.                
  8.                 if(p.getHealth() <= 0){
  9.                    
  10.                     p.setHealth(20);                
  11.                     p.setFoodLevel(20);          
  12.                     p.setFireTicks(0);          
  13.                     for(PotionEffect pot: p.getActivePotionEffects())p.removePotionEffect(pot.getType());
  14.                     p.playEffect(EntityEffect.TOTEM_RESURRECT);
  15.                    
  16.                 }
  17.             }
  18.         }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement