Posted August 21, 201312 yr I don't know how those fields work. Apparently they can be both negative and positive. What those fields really mean? Are they like the speed of the entity?
August 21, 201312 yr yea they are, negative motionY mean the entity is going down, technicly at 0, 0, 0 the entity doesn't move how to debug 101:http://www.minecraftforge.net/wiki/Debug_101 -hydroflame, author of the forge revolution-
August 21, 201312 yr to answer your question -- yes you can. simply test if motionX, motionY, AND motionZ are all == 0. If 0, the entity is truly stopped. The long answer...they are adjustment vectors from the current position. So, if entity is at X = 1.42, and motion X = -0.12, then after the next update tick, the entities position would be X=1.30. If motionX was +0.12, the entity would be instead at X=1.54. testing for exact zero for 'stopped' can be misleading...some of those numbers can be very small but non-zero, and the entity would appear stopped for all intents and purposes. It might be better to test for sqrt(mx*mx+my*my+mz*mz)<=0.002 to see if the entity is just moving really really slow, and might as well be stopped
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.