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.

how i get a existing keybind but one keybind vanilla that is, I did not create but she exists.

Featured Replies

Posted

how i get a existing keybind but one keybind vanilla that is, I did not create but she exists.

37 minutes ago, Ragnar said:

how i get a existing keybind but one keybind vanilla that is, I did not create but she exists.

There is a field in the Minecraft class called keyBindings.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

  • Author

I have to use the getKeybinds () method to get? If yes, then come what?I have to use the getKeybinds () method to get? If yes, then come what?

14 minutes ago, Ragnar said:

I have to use the getKeybinds () method to get? If yes, then come what?I have to use the getKeybinds () method to get? If yes, then come what?

Look through the code you can get any keybind you want from there.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

  • Author

Can you be clearer? I do not speak English very well because I'm from another country, so it's complicated to read the codes

The GameSettings class has public fields for all the vanilla key bindings. For example there is field keyBindLeft, keyBindRight, etc.

ย 

To check for these you should handle the KeyInputEvent and since it is client-side only you can use the Minecraft class to get the GameSettings instance then get the keybind then call method to check if it is pressed.ย 

ย 

For example: if (Minecraft.getMinecraft().gameSettings.keyBindLeft.isPressed()) { */ Do something here /* }

Check out my tutorials here:ย http://jabelarminecraft.blogspot.com/

  • Author

Thanks a lot, one more thing is it possible for me to get the KeyInputEvent event player? if yes how can I get it, because the method I want to use in KeyInputEvent uses EntityPlayer

22 minutes ago, Ragnar said:

Thanks a lot, one more thing is it possible for me to get the KeyInputEvent event player? if yes how can I get it, because the method I want to use in KeyInputEvent uses EntityPlayer

I know you solved it, but just in case other people come to this thread:

ย 

Whenever you're handling an event that is client-side only you are free to use the Minecraft.getMinecraft() method to get the instance of the Minecraft class. From there you can access all sorts of client-related things such as the player, keybinds, mouse movement, rendering stuff and so forth.

ย 

So you'll notice client side events often don't pass much information in the parameter because they know you can access it directly through Minecraft class.

Check out my tutorials here:ย http://jabelarminecraft.blogspot.com/

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.