Skip to content

Latest commit

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Minimal Minecraft Client

A minimal client implementation for Minecraft 1.19.4 (protocol version 762).

Features:

  • Authenticated server login
  • Server list pings
  • Offline mode servers
  • Packet encryption and compression
  • Lightweight (no dependencies)

Requires:

  • Java 11+

Usage

Javadocs

Maven
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependency>
<groupId>com.github.OfficialDonut</groupId>
<artifactId>MinimalMinecraftClient</artifactId>
<version>Tag</version>
</dependency>
Gradle
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.OfficialDonut:MinimalMinecraftClient:Tag'
}

Examples

See full examples in src/test.

Keep Alive Packets

Accountaccount = ...
Clientclient = newClient();
InboundPacketpacket = client.login(account, "localhost", 25565);
if (packet.getPacketID() == 2) { // login sucess packetwhile (true) {
packet = client.receive();
switch (packet.getPacketID()) {
case0x23: // keep alivelongid = packet.readLong();
OutboundPacketkeepAlivePacket = newOutboundPacket(0x12);
keepAlivePacket.writeLong(id);
client.send(keepAlivePacket);
break;
case0x19: // disconnectSystem.out.println("Disconnected: " + packet.readString());
return;
}
}
}

Server List Ping

Clientclient = newClient();
InboundPacketpacket = client.ping("localhost", 25565);
if (packet.getPacketID() == 0) { // status responseSystem.out.println("Status: " + packet.readString());
}

License

This project is licensed under the MIT License.

About

A minimal client implementation for Minecraft

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Contributors

Languages