To mods, you cannot close this thread by saying there is a previous one as I'm the original author of this thread. I requested the other thread to be closed but to no avail. If you really want me to bring plagiarism and legal action in, just ask me.
=========================
Outcome: Successfully set up MCP and create a simple, hotkeys, high jump hack + GUI. (And understand what you are doing unlike the other 3 tutorials out there that encourage C&P)
=========================
Prerequisites:
- Have a normal brain
- Have JDK installed (Video tutorial:
)
- Basic Java knowledge
=========================
What you'll need:
=========================
Tutorial:
MCP = Minecraft Coders Pack
Credits: Nick ~ checkKey function and Blic for the tutorial.- Do a clean force-update of your Minecraft to allow effective and stable decompiling
- Navigate to your ".minecraft" folder in your AppData (Press 'START' then 'RUN' then type '%appdata%\.minecraft').
- Extract MCP and run "cleanup.bat" and then "updatemcp.bat", this will update all the tools you will need to decompile and recompile your client with.
- Go back to your '.minecraft' folder and copy and paste the 'bin' and 'resources' folders into the MCP 'jars' folder.
- Run 'decompile.bat' afterwards, a 'src' & 'eclipse' folder should appear.
- Set your eclipse workspace to your MCP 'eclipse' folder.
- Time to get coding! In eclipse, set the workspace to the following folder. 'Client' > 'src' > 'net.minecraft.src', this will be our directory for creating our hacks.
- Navigate to the class file you see called 'GuiIngame.java'.
- What we're going to do here is create our hotkey & overlay base. But before we can do that, we're going to need to import the keyboard.
- Where you see the other "imports" at the top, import the keyboard via:
Code:
import org.lwjgl.input.Keyboard;
What this does is "call/declare" a raw Keyboard interface. This can be used to poll the current state of the keys, or read all the keyboard presses / releases since the last read.
11. Next we need to create our check keystates function. We first need to declare our keystates, we can do this via:
Code:
private boolean keyStates[];
Place this right under the class parenthesis.
12. What we've done is declared a new boolean, which is a true/false variable. In this case, any object that is placed between the brackets, applies with the true/false system.
Now we have to declare an instance of our boolean, in the initialization of the class, place:
Code:
keyStates = new boolean [256];
This means, our boolean, can be true/false for any of these numbers between 0 and 256.
13. Now for our actual check keystate code. Place this under the initialization, after the ending parenthesis.
Typing it out helps you understand what each statement does.
14. Now that you've done your hotkeys, you can do the GUI. Press 'CTRL' + 'F' and search for 'debug'. Create simple else statement at the bottom of the if.
Here is where we are going to put our actual toggle codes. Toggling is split up into two parts, part one, where the hotkeys are pressed, part two, where the overlay is created.
15. Scroll back to the top where you declared your 'keyStates' boolean. Now create another boolean for high jump.
What this did was create a true/false variable for the hack.
16. Now to do our toggle. Simply use the checkKey statement, then do the following:
17. Next, we have to draw onscreen whether our hack is on or off.
We can use fontrenderer, to draw a text overlay such as below.
18. At the moment, all we have created is a toggle, we now have to code the actual hack. Navigate to 'EntityLiving.java' and find the 'jump()' function. Add a simple if statement.
19. You have successfully created your first hacked client. To get the class files, goto your MCP folder then run 'recompile.bat' then 'reobfuscate.bat'. In the 'reobf' folder you will have the class files you can drag and drop into your 'minecraft.jar'.
(Remember to delete the META-INF folder)
Result (if done correctly):
Give credits if you use.
- Blic