ILuvYouCompanionCube Posted August 21, 2013 Share Posted August 21, 2013 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? Quote Link to comment Share on other sites More sharing options...
hydroflame Posted August 21, 2013 Share Posted August 21, 2013 yea they are, negative motionY mean the entity is going down, technicly at 0, 0, 0 the entity doesn't move Quote how to debug 101:http://www.minecraftforge.net/wiki/Debug_101 -hydroflame, author of the forge revolution- Link to comment Share on other sites More sharing options...
shadowmage4513 Posted August 21, 2013 Share Posted August 21, 2013 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 Quote Link to comment Share on other sites More sharing options...
ILuvYouCompanionCube Posted August 21, 2013 Author Share Posted August 21, 2013 I see. This way I get no negative numbers. You guys are smart! Thanks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.