public void hurt(Entity var1, int var2) {
		if(!this.level.creativeMode) {
			if(this.health > 0) {
				this.ai.hurt(var1, var2);
				if((float)this.invulnerableTime > (float)this.invulnerableDuration / 2.0F) {
					if(this.lastHealth - var2 >= this.health) {
						return;
					}

					this.health = this.lastHealth - var2;
				} else {
					this.lastHealth = this.health;
					this.invulnerableTime = this.invulnerableDuration;
					this.health -= var2;
					this.hurtTime = this.hurtDuration = 10;
				}

				this.hurtDir = 0.0F;
				if(var1 != null) {
					float var3 = var1.x - this.x;
					float var4 = var1.z - this.z;
					this.hurtDir = (float)(Math.atan2((double)var4, (double)var3) * 180.0D / 3.1415927410125732D) - this.yRot;
					this.knockback(var1, var2, var3, var4);
				} else {
					this.hurtDir = (float)((int)(Math.random() * 2.0D) * 180);
				}

				if(this.health <= 0) {
					this.die(var1);
				}

			}
		}
	}