Posted May 6, 201510 yr I want my vehicle to "jump" when the player presses space. Would I do it with Keyboard#isKeyDown() or make a new key bind for the space key? Creator of the MyFit, MagiCraft, Tesseract gun, and Papa's Wingeria mod.
May 6, 201510 yr I'd say make a KeyHandler and add a vehicle jump key (So the player can change it if they so choose) and then, handle the jumping. I'm pretty sure the horse does kind of what you're wanting to do so maybe check out that. I am not a cat. I know my profile picture is sexy and amazing beyond anything you could imagine but my cat like features only persist in my fierce eyes. I might be a cat.
May 6, 201510 yr Author Well I did that, but then Minecraft won't jump because the vehicle jump key is registered for space instead of player jump. Is there a way around this? Creator of the MyFit, MagiCraft, Tesseract gun, and Papa's Wingeria mod.
May 6, 201510 yr Check if the player is riding an entity and, if it is your vehicle. Then: disable space for jump and enable it for the vehicle the player is riding. When the player is riding a horse, the space bar contributes to the horse the player is riding, otherwise, the spacebar is for the player's jumping. I am not a cat. I know my profile picture is sexy and amazing beyond anything you could imagine but my cat like features only persist in my fierce eyes. I might be a cat.
May 6, 201510 yr Author Check where Creator of the MyFit, MagiCraft, Tesseract gun, and Papa's Wingeria mod.
May 7, 201510 yr Why not just use the regular vanilla jump key? You can handle that in a KeyInputEvent just like you would a custom key binding, with the advantage of being very intuitive for players (jump key jumps for everything) and still customizable. Another alternative you may consider is that you could simply let the player jump as normal while riding your vehicle, and then have the vehicle y motion match the player's, then you wouldn't need any key handling at all. I doubt that's how horses / minecarts work, but depending on what your vehicle is (e.g. a pogo-stick ), it could be an option. http://i.imgur.com/NdrFdld.png[/img]
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.