- 5
- 0
Попробовал проделать такие же манипуляции, как в классе эндермена на своем мобе, но ничего не получается.
Класс моба:
public void onEntityUpdate() {
super.onEntityUpdate();
EntityPlayer par1 = this.worldObj.getClosestVulnerablePlayerToEntity(this, 64.0D);
if (par1 != null && isPlayerLooking(par1)) {
setFire(2);
}
}
private boolean isPlayerLooking(EntityPlayer p_70821_1_) {
Vec3 vec3 = p_70821_1_.getLook(1.0F).normalize();
Vec3 vec31 = Vec3.createVectorHelper(this.posX - p_70821_1_.posX, this.boundingBox.minY + (double)(this.height / 2.0F) - (p_70821_1_.posY + (double)p_70821_1_.getEyeHeight()), this.posZ - p_70821_1_.posZ);
double d0 = vec31.lengthVector();
vec31 = vec31.normalize();
double d1 = vec3.dotProduct(vec31);
return d1 > 1.0D - 0.025D / d0 && p_70821_1_.canEntityBeSeen(this);
}