Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public String health(int health) {
- String amount = "";
- int count = 0;
- if(count<=health) {
- amount = amount + "❤";
- count++;
- }
- return amount;
- }
- public String lostHealth(int current, int full) {
- String name = "";
- int amount = full - current;
- String lostH = "";
- int count = 0;
- if(count<=current) {
- name = name + "❤";
- count++;
- }
- int count2 = 0;
- if(count2<=amount) {
- lostH = lostH + "♡";
- count2++;
- }
- name = name + lostH;
- return name;
- }
- @EventHandler
- public void onDamager(EntityDamageByEntityEvent event) {
- Creature hurtee = (Creature)event.getEntity();
- hurtee.setCustomName(ChatColor.GREEN + lostHealth(hurtee.getHealth(), hurtee.getMaxHealth()));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement