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

Hello All,

 

I'm new to keybinds and can't find a tutorial for them anywhere, I figured out how to register a new KeyHandler and have created this class (Haven't edited any of the contents yet as I'm not sure what to do).

This is the class Eclipse made for me:

 

package yagoki.mods.weapons;


import java.util.EnumSet;


import net.minecraft.client.settings.KeyBinding;
import cpw.mods.fml.client.registry.KeyBindingRegistry.KeyHandler;
import cpw.mods.fml.common.TickType;


public class KeyBindingHandler extends KeyHandler {


public KeyBindingHandler(KeyBinding[] keyBindings)
{
	super(keyBindings);
}


@Override
public String getLabel()
{
	return null;
}


@Override
public void keyDown(EnumSet<TickType> types, KeyBinding kb, boolean tickEnd, boolean isRepeat)
{


}


@Override
public void keyUp(EnumSet<TickType> types, KeyBinding kb, boolean tickEnd)
{


}


@Override
public EnumSet<TickType> ticks()
{
	return null;
}


}

 

 

 

 

What do I need to change in here so I can code the double jump (I guess this is done in the key down or key up section)

 

 

Thanks in advance

In my common proxy I put this

public void registerKeyBindingHandler()
{
	KeyBinding[] keybind = new KeyBinding[]{};
	KeyBindingRegistry.registerKeyBinding(new KeyBindingHandler(keybind));
}

I'm not sure if what i did is correct though. And in my main mod class, in the init function I put

proxy.registerKeyBindingHandler();

That's all I figured out so far. I'm new to keybinds as well.

  • Author

i already got this far, just not sure how to use it to detect the double jump, which is the part i'm not sure on.

Thanks anyway

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.