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'm sure I've missed something minor, and whatnot, but for the life of me I can't figure out what.
The Keybind shows up in the controls, but when pressed does nothing, not even print to the console.

Here's my code right now. 

 

Spoiler

My Main Class
 

Spoiler


public class AssassinSkills
{
    public static final String NAME = "Assassin Skills";
    public static final String MODID = "Assassin";
    public static final String VERSION = "1.7.10-R1";
 
    @Mod.Instance("Assassin")
    public static AssassinSkills instance;
 
    @Mod.EventHandler
    public void preInit(FMLPreInitializationEvent event) {
        AssassinSkillsKeybinds.register();
        
            scala.Console.print(MODID + ":preInit");
    }
 
    @Mod.EventHandler
    public void init(FMLInitializationEvent event) {
        scala.Console.print(MODID + ":init");
    }
 
    @Mod.EventHandler
    public void postInit(FMLPostInitializationEvent event) {
        scala.Console.print(MODID + ":init");
        

    }
}

 


Key Input

Spoiler


public class TimeSkip
{

    public Minecraft mc = Minecraft.getMinecraft();
    EntityPlayer player = mc.thePlayer;
    
    
    double distance = 128;
    double a = 120;
    double dx = -Math.sin(a) * distance;
    double dy = Math.sin(a) * distance;
    double dz = Math.cos(a) * distance;



@SubscribeEvent
     public void onKeyInput(KeyInputEvent event)
     {
    System.out.println("Key Input Event");
    if (AssassinSkillsKeybinds.timeskip_key.isPressed())
    {
        scala.Console.print(AssassinSkillsKeybinds.timeskip_key.isPressed());
         System.out.println("Key binding =" + AssassinSkillsKeybinds.timeskip_key.getKeyDescription());
         //player.setPositionAndUpdate(player.posX + dx, player.posY + dy, player.posZ + dz);
    }
    }
}

 

Registering Keybinds
 

Spoiler


public class AssassinSkillsKeybinds
{
    public static KeyBinding timeskip_key;
 
    public static void register()
    {
        timeskip_key = new KeyBinding("key.timeskip", Keyboard.KEY_NUMPAD0, "key.categories.AssassinSkills");
 
        ClientRegistry.registerKeyBinding(timeskip_key);
    }

        
    
}

 

 

 

Edited by Cyndrana

  • Guest locked this topic
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.