Posted October 29, 201311 yr What exactly causes the EntityPlayer to move? I can get the EntityPlayer object without modifying base code, but i absolutely cannot figure out how to move the EntityPlayer in the same way that he would move if i were to press "w,a,s,d". Does anyone know of a method? I know bukkit has a PlayerMoveEvent, but i cannot find anything like this in forge.
October 29, 201311 yr greyminecraftcoder.blogspot.no/p/list-of-topics.html This page contains a lot of information about how minecraft works internally. Theres a section on how input works, this could help you dig deeper into it by seeing what invokes the relevant methods and trace it to player movement. But uhm couldn't you just modify his velocity? If you guys dont get it.. then well ya.. try harder...
October 29, 201311 yr Author Hmmm I hadn't thought about changing velocity. And i cant seem to find where he talks about the methods invoked by pushing the "wasd" keys.
October 29, 201311 yr He talks about input, how it handles the overall inputs and from that you could probably find the classes involved and use your IDE to find which stuff calls upon the relevant methods for key input etc. I'm pretty sure the players position is moved related to his current velocity and movement speed, that's at least a common way to do it If you guys dont get it.. then well ya.. try harder...
October 29, 201311 yr Author Thanks! this very well may work! Also, do you know a way to make a character jump? I'm going to have to detect possible collisions and jump over them.
October 29, 201311 yr Author Lol yeah.. i slapped myself in the face after i asked that... haha. Anyways thanks alot for the help its working now!
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.