Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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.

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. :P

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.

  • 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.

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.

  • Author

Check where

Creator of the MyFit, MagiCraft, Tesseract gun, and Papa's Wingeria mod.

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 :P ), it could be an option.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.