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

Ive been trying to make a vehicle mod, but the only way i can find of allowing the player to control motion is by using the mounted entity's motion values. What i want to achieve is for the ws keys to control forward/backward motion and for the ad keys to steer it. Is there any way of tapping in to the player's key handler so it can be used to control the car ?

  • Author

u can check the motion, the position, create a key handler, there are a lot of methods...

 

My current system uses motion, but that only gets what direction the player is trying to move, not what keys are being pressed ( i may try to separate the motion in to two vectors representing ad & ws but i recon there is an easier way to do this). Position is much the same as motion, and would be very hard to resolve back to the original keys. Finally, a key handler was my first idea for controlling motion, unfortunately, it overrides vanilla key bindings so when the player exits the car, they can no longer move.

Why not set it to custom controls via keybinding them? Just like BMW Car mod does it, they dont override the vannila controls, they present own control setting for users.

~I was here~

If you want to know when the key binding assigned to move forward/backward/etc. is pressed, you should check (client side) when FMLClientHandler.instance().getClient().gameSettings.keyBindForward.pressed is true. GameSettings holds all the vanilla keybinds, and that way you'll always know when the right key is pressed, even if the player ever changes it.

Then you need to relay the info to the server, but it seems to me you already know how to do that.

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.