Jump to content

Registering keybinds for double jump


Yagoki

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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