health -= healthAdd;
}
} else {
DataWatcher watcher = getWatcher(text, (loadUp ? 300 : 0));
PacketPlayOutEntityMetadata metaPacket = getMetadataPacket(watcher);
PacketPlayOutEntityDestroy destroyEntityPacket = getDestroyEntityPacket();
PacketHelper.sendPacket(player, metaPacket);
PacketHelper.sendPacket(player, destroyEntityPacket);
hasHealthBar.put(player.getName(), false);
//Complete text
PacketPlayOutSpawnEntityLiving mobPacket = getMobPacket(completeText, player.getLocation(), 200);
PacketHelper.sendPacket(player, mobPacket);
hasHealthBar.put(player.getName(), true);
DataWatcher watcher2 = getWatcher(completeText, 300);
PacketPlayOutEntityMetadata metaPacket2 = getMetadataPacket(watcher2);
PacketHelper.sendPacket(player, metaPacket2);
new BukkitRunnable() {
@Override
public void run() {
PacketPlayOutEntityDestroy destroyEntityPacket = getDestroyEntityPacket();
PacketHelper.sendPacket(player, destroyEntityPacket);
hasHealthBar.put(player.getName(), false);
}
}.runTaskLater(DenizenAPI.getCurrentInstance(), 40L);
this.cancel();