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 was wondering how I would check if a vanilla keybind is pressed without overwriteing it. I can't seem to find any kind of keybinding handler for the vanilla binds, the keybind class is the closest I could get but it seems very odd in how it works and gives me no way to check if a specific keybind is active. Setting my keybind to that key simply overwrites it and nulifies the vanilla one (which isn't an option considering the one i'm going for is space :/ ) Anyone know a good way of doing this?

Creator of Metroid Cubed! Power Suits, Beams, Hypermode and more!

width=174 height=100http://i.imgur.com/ghgWmA3.jpg[/img]

This is what I use in my SmartLights mod that I've been working on, to see if the player is sneaking:

 

int sneak = Minecraft.getMinecraft().gameSettings.keyBindSneak.keyCode;

if (Keyboard.isKeyDown(sneak))
{
    // Do stuff
}

 

Note:

 

I  use it in onBlockActivated() so I have access to a World object for checking isRemote to avoid crashing. I'm not sure if it's necessary since the Keyboard object is from the library lwjgLinput which should be loaded by the server too. I haven't tested my mod in MP yet.

Guest
This topic is now closed to further replies.

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.