Advertisement
monkeyboystein

Untitled

Jun 21st, 2013
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. public String health(int health) {
  2. String amount = "";
  3. int count = 0;
  4. if(count<=health) {
  5. amount = amount + "❤";
  6. count++;
  7. }
  8.  
  9.  
  10. return amount;
  11. }
  12. public String lostHealth(int current, int full) {
  13. String name = "";
  14. int amount = full - current;
  15. String lostH = "";
  16. int count = 0;
  17. if(count<=current) {
  18. name = name + "❤";
  19. count++;
  20. }
  21. int count2 = 0;
  22. if(count2<=amount) {
  23. lostH = lostH + "♡";
  24. count2++;
  25. }
  26. name = name + lostH;
  27.  
  28. return name;
  29. }
  30. @EventHandler
  31. public void onDamager(EntityDamageByEntityEvent event) {
  32. Creature hurtee = (Creature)event.getEntity();
  33. hurtee.setCustomName(ChatColor.GREEN + lostHealth(hurtee.getHealth(), hurtee.getMaxHealth()));
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement