Results 1 to 1 of 1

Thread: Minecraft binding commands

  1. #1
    ... connecting woodchop146's Avatar
    Join Date
    Aug 2013
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Minecraft binding commands

    For this to work you'll need Minecraft Coder Pack and JDK7u25. There is more then enough tutorials on this if you Google it

    First you're going to have to import this:
    Code:
    import org.lwjgl.input.Keyboard;
    Click image for larger version. 

Name:	2.png 
Views:	29 
Size:	22.4 KB 
ID:	387

    Secondly:
    Code:
    private boolean keyStates[];
    Click image for larger version. 

Name:	3.png 
Views:	27 
Size:	13.3 KB 
ID:	388

    Then...:
    Code:
    keyStates = new boolean[256];
    }
        public boolean checkKey1(int i)
        {
                if(mc.currentScreen !=null)
                {
                        return false;
                }
                if(Keyboard.isKeyDown(i) != keyStates[i])
                {
                        return keyStates[i] = !keyStates[i];
                }else
                {
                        return false;
                }
        }
    Click image for larger version. 

Name:	4.png 
Views:	28 
Size:	48.4 KB 
ID:	389

    Finally, you're gonna have to add the actual key events:
    Code:
    if (checkKey1(Keyboard.KEY_DOWN)){
                    mc.thePlayer.sendChatMessage("/afk");
                }
                if (checkKey1(Keyboard.KEY_UP)){
                    mc.thePlayer.sendChatMessage("/home home");
                }
    Click image for larger version. 

Name:	1.png 
Views:	30 
Size:	7.9 KB 
ID:	386

    This should be located under the if statement that refers to F3:
    Code:
    if (this.mc.gameSettings.showDebugInfo)
    Last edited by woodchop146; 15th August 2013 at 00:58.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •