Posted October 3, 201213 yr Now I have managed to get my entities running. They spawn with the intended initial data, can be interacted with etc .... and can be mounted. But ... I can move the mounted player/entity a few blocks, then the mount and player are moving back to the original location (where the player has mounted the entity)... I have searched in the vanilla boat and pig code, but could not find anything that would indicate to address this issue ... does anybody know to fix this? Or where I could try to look for a solution? running minecraft on Mac OS X - Sierra --- creating code since 1986 ... --- मेरा दिल भारतवासी है! http://www.arno-saxena.de/pictures/chococraft/banner_signature.png[/img]
October 3, 201213 yr It seems that you only update the position / movement in the client thread. The server entity doesn't move at all then and because Minecraft updates positions a bit lazily, you can move a few blocks and then you'll be teleported back to the server's position. Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! | mah twitter This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.
October 3, 201213 yr Author yes, and how do I convince the server to do the moving too? running minecraft on Mac OS X - Sierra --- creating code since 1986 ... --- मेरा दिल भारतवासी है! http://www.arno-saxena.de/pictures/chococraft/banner_signature.png[/img]
October 4, 201213 yr Author so I came to the conclusion I have to do it completely myself with a PacketHandler. But is there a convenient time/place to trigger the send? Just in the routine doing the move itself would be imho a bit much for the sake of packet traffic. An elegant solution would be a request from the server to the client to send the current position right before updating the client position. But doesn't the server send it's packets via the PacketHandler only every now and then via a queue and not intermediately after giving the send order? Thus would such a construct be always late... Thus, is there a direct channel from server to client for such functionalities? and additionally, why can't I find anything regarding such issues in the vanilla boat or pig code? Or am I just to daft to recognise it? running minecraft on Mac OS X - Sierra --- creating code since 1986 ... --- मेरा दिल भारतवासी है! http://www.arno-saxena.de/pictures/chococraft/banner_signature.png[/img]
October 6, 201213 yr That is because the vanilla boat/pig and such do it on the server side, not the client side. Player position set on the server side is automatically translated to the client. For interpolation reasons you might want to set it on both though.
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.