#
1. Making the Hook
Hooking our client to the Minecraft main class.
#
Making Our Main Class
- Navigate to
src/main/java
and create a package (e.g.,com.demez
). - Inside the package, create a new class and name it as you wish. This will be your Main class.
Here is an example of a Main class:
package com.demez;
import org.lwjgl.Display;
public class YourClient {
public YourClient INSTANCE = new YourClient();
public String name = "YourClient";
public String version = "1.0.0";
public void init(){
// Prints "Client launched" to the console.
System.out.println("Client launched.");
// Sets the window title to your client name and version.
Display.setTitle(name + " " + version);
}
}
#
Hooking Our Main Class
Open the
Minecraft.java
class.Press
Ctrl + F
and search forthis.ingamegui
.Below that line, add the following code:
YourClient.INSTANCE.init();
Launch the game. You should see
"Client launched"
text in the console.