Posted January 25, 201510 yr Basically, I need to access an instance of player to change motionX, motionY, etc. How would I reference the main, or the being controlled instance of Player?
January 25, 201510 yr Author OK, basically, I need to change the player's motionX and motionY. How do I do this?
January 25, 201510 yr Basically: player.motionX = someValue; player.motionZ = someValue; It would help if you provided some context for what you are trying to do. When, exactly, do you need to change the player's motion? http://i.imgur.com/NdrFdld.png[/img]
January 26, 201510 yr Author I'm trying to call it within a method: public void roll(Player player) { player.motionX = 10; } I just need to know what to put in the parameter for player when I'm referencing it.
January 26, 201510 yr You need packets. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
January 26, 201510 yr Author You sure? I did it with onUpdate before in a class that extends Item without packets.
January 27, 201510 yr Author I'd use a tick handler, not sure which one, though. I would assume server, though, correct? (Of course I would use an if inside of the method)
January 27, 201510 yr Author My main question is what instance of player do I refer to to change motionX and motionY. I still need to know that to finish.
January 27, 201510 yr My main question is what instance of player do I refer to to change motionX and motionY. I still need to know that to finish. If you're sending packets to the server (which you should be) then the one you modify is the one that sent the packet. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
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.