Posted February 25, 201411 yr I want to know if there is any method like .isEntityMoving() or .getEntityVelocity() which return if the entity is moving or still. Is there some methor or not? Thanks for helping.
February 26, 201411 yr Use entity.motionX, motionY, and motionZ. http://i.imgur.com/NdrFdld.png[/img]
February 26, 201411 yr Author Use entity.motionx, motiony, and motionz. Then i suppose that if all those fields are equals to 0, the entity is still, am i right?
February 26, 201411 yr That's right, though motionY can be a bit odd sometimes, so you can also check entity.onGround if you really care about the vertical motion. If you need the entity's velocity, you can use the Pythagorean formula Math.sqrt(x * x + y * y + z * z) to get the velocity, including or leaving out y depending on your needs. http://i.imgur.com/NdrFdld.png[/img]
February 26, 201411 yr Author That's right, though motionY can be a bit odd sometimes, so you can also check entity.onGround if you really care about the vertical motion. If you need the entity's velocity, you can use the Pythagorean formula Math.sqrt(x * x + y * y + z * z) to get the velocity, including or leaving out y depending on your needs. Ok, thanks
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.