Advertisement
Corosus

Untitled

Aug 13th, 2011
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. //initial target vector calculation - do every tick, fix for proper targeting variables
  2. double var11 = this.targetedEntity.posX - this.posX;
  3. double var13 = this.targetedEntity.boundingBox.minY + (double)(this.targetedEntity.height / 2.0F) - (this.posY + (double)(this.height / 2.0F));
  4. double var15 = this.targetedEntity.posZ - this.posZ;
  5.  
  6.  
  7. //
  8. double var14 = (double)MathHelper.sqrt_double(var11 * var11 + var13 * var13 + var15 * var15 );
  9. this.motionX = var11 / var14 * 0.1D;
  10. this.motionY = var13 / var14 * 0.1D;
  11. this.motionZ = var15 / var14 * 0.1D;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement